Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
evilbutcher committed Nov 24, 2022
1 parent 0bee005 commit 44e42db
Show file tree
Hide file tree
Showing 62 changed files with 8,564 additions and 476 deletions.
51 changes: 47 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

绝大多数代码都用到了@chavyleung 的 Env.js 和@Peng-YM 的 OpenAPI.js,感谢!

如果能请杯奶茶,就很感谢啦!
<img src="https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/picture/photo.jpeg" height="40%" width="40%">

## 脚本合集

### 【BoxJs】订阅
Expand All @@ -15,7 +18,7 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/evilbutcher.bo
### 【Quantumult X】脚本订阅合集+自己写的去广告

https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/QuantumultX.rewrite.conf
https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/QuantumultX.task.conf (需要将内容复制到[task_local]
https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/QuantumultX.task.json

### 【Surge】脚本订阅合集

Expand Down Expand Up @@ -46,6 +49,13 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c
3. 支持 BoxJs。
4. checkin_env.js 修改自@Neurogram-R,增加了多平台支持。

### [公众号监控](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/wechatsubs/wechatsubs.js)

#### 功能特点

1. 设定关键词监控公众号推送。
2. 可自定关键词推送间隔。

### [热门监控](https://github.com/evilbutcher/Quantumult_X/tree/master/check_in/hotsearch/hot.js)

#### 功能特点
Expand All @@ -66,7 +76,7 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c
14. 监控 36 氪关键词。
15. 监控 Kindle 图书关键词。
16. 监控 RSSHub 订阅,感谢@api-evangelist-[rss2json](https://github.com/api-evangelist/rss2json)
17. 监控人人影视最新上传,配合捷径[磁力离线](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209)可实现磁力下载,解锁追剧新姿势。
17. ~~监控人人影视最新上传,配合捷径[磁力离线](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209)可实现磁力下载,解锁追剧新姿势。~~
18. 可自定关键词推送间隔。

### [App 价格监控](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/appstore/AppMonitor.js)
Expand All @@ -90,21 +100,54 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c

#### 功能特点

1. 可选择随机 or 最新内容
1. 可选择随机 or 最新内容

### [Funboat](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/funboat/funboat.js)

#### 功能特点

1. 喜欢 funko 可以关注该微信小程序。

### [九木杂物社](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/jiumu/jiumu.js)

#### 功能特点

1. 九木杂物社自动签到。

### [酷乐潮玩](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/klcw)

#### 功能特点

1. 酷乐潮玩小程序、App 自动签到。

### [信息查询](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/wechatsubs)

#### 功能特点

1. 支持事业单位招聘监控。
2. 支持高校人才网监控。

### [彩票查询](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/ssq/ssq.js)

#### 功能特点

1. 支持双色球、大乐透、福彩 3D、七乐彩。
2. 支持仅查询当日开奖的彩票。

### [华住会](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/hzh/hzh.js)

#### 功能特点

1. 自动签到。
2. 领取奖励(开发中)。

## 规则类

### [去广告](https://github.com/evilbutcher/Quantumult_X/tree/master/remove_ad)

#### 功能特点

[readme](https://github.com/evilbutcher/Quantumult_X/tree/master/remove_ad/README.md)
[Readme](https://github.com/evilbutcher/Quantumult_X/tree/master/remove_ad/README.md)

### 免责声明

Expand Down
22 changes: 21 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c
2. View traffic information.
3. Support BoxJs.
4. Checkin_env.js is modified from @Neurogram-R, adding multi-platform support.
5. GitHub Action has been supported. First, Fork this repo, add CHECKIN_TITLE CHECKIN_URL CHECKIN_EMAIL CHECKIN_PASSWORD four data in the Secrets of the forked repo. Different accounts are separated by &. Both schedule and Star your repo, checkin can be run. Please refer to [pull](https://github.com/wei/pull/blob/master/README.md) on how to keep in sync.

### [Wechatsubs](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/wechatsubs/wechatsubs.js)

#### Features

1. You can set keywords to monitor the push of Wechat Subscriptions.
2. You can customize the keyword push interval.

### [Hotlist Monitor](https://github.com/evilbutcher/Quantumult_X/tree/master/check_in/hotsearch/hot.js)

Expand All @@ -64,7 +72,7 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c
14. Monitor 36Kr keywords.
15. Monitor Kindle book keywords.
16. Monitor RSSHub feeds, thanks to @api-evangelist-[rss2json](https://github.com/api-evangelist/rss2json).
17. Monitor the latest uploads of RenRenTV, with shortcuts [magnetic offline](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209) can achieve magnetic download, unlocking a new way to catch up on dramas.
17. ~~Monitor the latest uploads of RenRenTV, with shortcuts [magnetic offline](https://www.icloud.com/shortcuts/cfad8390798e459db458d6233d229209) can achieve magnetic download, unlocking a new way to catch up on dramas.~~
18. You can customize the keyword push interval.

### [App Price Monitor](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/appstore/AppMonitor.js)
Expand Down Expand Up @@ -96,6 +104,18 @@ https://raw.githubusercontent.com/evilbutcher/Quantumult_X/master/Loon.scripts.c

1. Who like funko can follow the WeChat app.

### [Jiumu](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/jiumu/jiumu.js)

#### Features

1. Automatic check-in.

### [KuLeChaoWan](https://github.com/evilbutcher/Quantumult_X/blob/master/check_in/klcw)

#### Features

1. Automatic check-in.

### Disclaimer

1. This script is only used for study and research, and does not guarantee its legitimacy, accuracy, and validity. Please make your own judgment based on the situation. I do not assume any guarantee responsibility for this.
Expand Down
108 changes: 79 additions & 29 deletions check_in/appstore/AppMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function post_data(d) {
app_monitor = {};
} else {
app_monitor = JSON.parse(app_monitor);
console.log(app_monitor);
console.log(JSON.stringify(app_monitor));
}
let infos = {};
await Promise.all(
Expand Down Expand Up @@ -151,19 +151,19 @@ async function post_data(d) {
$.write(infos, "app_monitor");
if (notifys.length > 0) {
notify(notifys);
$.done();
} else {
console.log("APP监控:版本及价格无变化");
$.done;
$.done();
}
} catch (e) {
console.log(e);
}
}
function notify(notifys) {
notifys = notifys.join("\n");
console.log(notifys);
console.log(JSON.stringify(notifys));
$.notify("APP监控", "", notifys);
$.done;
}
function flag(x) {
var flags = new Map([
Expand Down Expand Up @@ -283,7 +283,11 @@ function flag(x) {
return flags.get(x.toUpperCase());
}

//From Peng-YM's OpenAPI.js
/**
* OpenAPI
* @author: Peng-YM
* https://github.com/Peng-YM/QuanX/blob/master/Tools/OpenAPI/README.md
*/
function ENV() {
const isQX = typeof $task !== "undefined";
const isLoon = typeof $loon !== "undefined";
Expand All @@ -292,17 +296,41 @@ function ENV() {
const isNode = typeof require == "function" && !isJSBox;
const isRequest = typeof $request !== "undefined";
const isScriptable = typeof importModule !== "undefined";
return { isQX, isLoon, isSurge, isNode, isJSBox, isRequest, isScriptable };
return {
isQX,
isLoon,
isSurge,
isNode,
isJSBox,
isRequest,
isScriptable,
};
}

function HTTP(baseURL, defaultOptions = {}) {
function HTTP(
defaultOptions = {
baseURL: "",
}
) {
const { isQX, isLoon, isSurge, isScriptable, isNode } = ENV();
const methods = ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"];
const URL_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/;

function send(method, options) {
options = typeof options === "string" ? { url: options } : options;
options.url = baseURL ? baseURL + options.url : options.url;
options = { ...defaultOptions, ...options };
options =
typeof options === "string"
? {
url: options,
}
: options;
const baseURL = defaultOptions.baseURL;
if (baseURL && !URL_REGEX.test(options.url || "")) {
options.url = baseURL ? baseURL + options.url : options.url;
}
options = {
...defaultOptions,
...options,
};
const timeout = options.timeout;
const events = {
...{
Expand All @@ -317,7 +345,10 @@ function HTTP(baseURL, defaultOptions = {}) {

let worker;
if (isQX) {
worker = $task.fetch({ method, ...options });
worker = $task.fetch({
method,
...options,
});
} else if (isLoon || isSurge || isNode) {
worker = new Promise((resolve, reject) => {
const request = isNode ? require("request") : $httpClient;
Expand Down Expand Up @@ -413,8 +444,8 @@ function API(name = "untitled", debug = false) {
});
};
}
// persistance

// persistence
// initialize cache
initCache() {
if (isQX) this.cache = JSON.parse($prefs.valueForKey(this.name) || "{}");
Expand All @@ -428,7 +459,9 @@ function API(name = "untitled", debug = false) {
this.node.fs.writeFileSync(
fpath,
JSON.stringify({}),
{ flag: "wx" },
{
flag: "wx",
},
(err) => console.log(err)
);
}
Expand All @@ -440,7 +473,9 @@ function API(name = "untitled", debug = false) {
this.node.fs.writeFileSync(
fpath,
JSON.stringify({}),
{ flag: "wx" },
{
flag: "wx",
},
(err) => console.log(err)
);
this.cache = {};
Expand All @@ -454,20 +489,24 @@ function API(name = "untitled", debug = false) {

// store cache
persistCache() {
const data = JSON.stringify(this.cache);
const data = JSON.stringify(this.cache, null, 2);
if (isQX) $prefs.setValueForKey(data, this.name);
if (isLoon || isSurge) $persistentStore.write(data, this.name);
if (isNode) {
this.node.fs.writeFileSync(
`${this.name}.json`,
data,
{ flag: "w" },
{
flag: "w",
},
(err) => console.log(err)
);
this.node.fs.writeFileSync(
"root.json",
JSON.stringify(this.root),
{ flag: "w" },
JSON.stringify(this.root, null, 2),
{
flag: "w",
},
(err) => console.log(err)
);
}
Expand All @@ -477,11 +516,11 @@ function API(name = "untitled", debug = false) {
this.log(`SET ${key}`);
if (key.indexOf("#") !== -1) {
key = key.substr(1);
if (isSurge & isLoon) {
$persistentStore.write(data, key);
if (isSurge || isLoon) {
return $persistentStore.write(data, key);
}
if (isQX) {
$prefs.setValueForKey(data, key);
return $prefs.setValueForKey(data, key);
}
if (isNode) {
this.root[key] = data;
Expand All @@ -496,7 +535,7 @@ function API(name = "untitled", debug = false) {
this.log(`READ ${key}`);
if (key.indexOf("#") !== -1) {
key = key.substr(1);
if (isSurge & isLoon) {
if (isSurge || isLoon) {
return $persistentStore.read(key);
}
if (isQX) {
Expand All @@ -514,11 +553,11 @@ function API(name = "untitled", debug = false) {
this.log(`DELETE ${key}`);
if (key.indexOf("#") !== -1) {
key = key.substr(1);
if (isSurge & isLoon) {
$persistentStore.write(null, key);
if (isSurge || isLoon) {
return $persistentStore.write(null, key);
}
if (isQX) {
$prefs.removeValueForKey(key);
return $prefs.removeValueForKey(key);
}
if (isNode) {
delete this.root[key];
Expand Down Expand Up @@ -549,7 +588,7 @@ function API(name = "untitled", debug = false) {
let opts = {};
if (openURL) opts["openUrl"] = openURL;
if (mediaURL) opts["mediaUrl"] = mediaURL;
if (JSON.stringify(opts) == "{}") {
if (JSON.stringify(opts) === "{}") {
$notification.post(title, subtitle, content);
} else {
$notification.post(title, subtitle, content, opts);
Expand All @@ -574,15 +613,15 @@ function API(name = "untitled", debug = false) {

// other helper functions
log(msg) {
if (this.debug) console.log(msg);
if (this.debug) console.log(`[${this.name}] LOG: ${this.stringify(msg)}`);
}

info(msg) {
console.log(msg);
console.log(`[${this.name}] INFO: ${this.stringify(msg)}`);
}

error(msg) {
console.log("ERROR: " + msg);
console.log(`[${this.name}] ERROR: ${this.stringify(msg)}`);
}

wait(millisec) {
Expand All @@ -600,5 +639,16 @@ function API(name = "untitled", debug = false) {
}
}
}

stringify(obj_or_str) {
if (typeof obj_or_str === "string" || obj_or_str instanceof String)
return obj_or_str;
else
try {
return JSON.stringify(obj_or_str, null, 2);
} catch (err) {
return "[object Object]";
}
}
})(name, debug);
}
Loading

0 comments on commit 44e42db

Please sign in to comment.