koishi-plugin-weibo-post-monitor 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +5 -4
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface Config {
|
|
|
5
5
|
plantform: string;
|
|
6
6
|
waitMinutes: number;
|
|
7
7
|
sendINFO: any;
|
|
8
|
+
using_cookie: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const Config: Schema<Config>;
|
|
10
11
|
export declare function to<T, U = Error>(promise: Promise<T>, errorExt?: object): Promise<[U, undefined] | [null, T]>;
|
package/lib/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var Config = import_koishi.Schema.object({
|
|
|
43
43
|
account: import_koishi.Schema.string().description("账号(qq号)"),
|
|
44
44
|
plantform: import_koishi.Schema.string().default("onebot").description("账号平台"),
|
|
45
45
|
waitMinutes: import_koishi.Schema.number().default(3).min(1).description("隔多久拉取一次最新微博 (分钟)"),
|
|
46
|
-
|
|
46
|
+
using_cookie: import_koishi.Schema.string().description("cookie"),
|
|
47
47
|
sendINFO: import_koishi.Schema.array(import_koishi.Schema.object({
|
|
48
48
|
weiboUID: import_koishi.Schema.string().description("微博用户UID"),
|
|
49
49
|
forward: import_koishi.Schema.boolean().default(false).description("是否监听转发"),
|
|
@@ -67,7 +67,8 @@ function apply(ctx, config) {
|
|
|
67
67
|
const commonConfig = {
|
|
68
68
|
account: config.account,
|
|
69
69
|
plantform: config.plantform,
|
|
70
|
-
waitMinutes: config.waitMinutes
|
|
70
|
+
waitMinutes: config.waitMinutes,
|
|
71
|
+
using_cookie: config.using_cookie
|
|
71
72
|
};
|
|
72
73
|
ctx.setInterval(async () => {
|
|
73
74
|
for (const singleConfig of config.sendINFO) {
|
|
@@ -165,7 +166,7 @@ var getMessage = /* @__PURE__ */ __name((params, wbPost) => {
|
|
|
165
166
|
return { post: wbpost, islast: true };
|
|
166
167
|
}, "getMessage");
|
|
167
168
|
var getWeibo = /* @__PURE__ */ __name(async (config, callback) => {
|
|
168
|
-
const { weiboUID,
|
|
169
|
+
const { weiboUID, using_cookie } = config;
|
|
169
170
|
if (!weiboUID) {
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
@@ -173,7 +174,7 @@ var getWeibo = /* @__PURE__ */ __name(async (config, callback) => {
|
|
|
173
174
|
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
|
174
175
|
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
|
175
176
|
"cache-control": "no-cache",
|
|
176
|
-
"cookie":
|
|
177
|
+
"cookie": using_cookie,
|
|
177
178
|
"referer": "https://www.weibo.com/u/7730797357",
|
|
178
179
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
|
|
179
180
|
};
|
package/package.json
CHANGED