koishi-plugin-weibo-post-monitor 0.0.6 → 0.0.7
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.js +7 -6
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -43,6 +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
|
+
cookie: import_koishi.Schema.string().description("cookie"),
|
|
46
47
|
sendINFO: import_koishi.Schema.array(import_koishi.Schema.object({
|
|
47
48
|
weiboUID: import_koishi.Schema.string().description("微博用户UID"),
|
|
48
49
|
forward: import_koishi.Schema.boolean().default(false).description("是否监听转发"),
|
|
@@ -92,6 +93,7 @@ var getWeiboAndSendMessageToGroup = /* @__PURE__ */ __name(async (ctx, params) =
|
|
|
92
93
|
if (params.sendAll) {
|
|
93
94
|
message = import_koishi.h.at("all") + " " + message;
|
|
94
95
|
}
|
|
96
|
+
ctx.bots[`${params.plantform}:${params.account}`].sendMessage(params.groupID, message);
|
|
95
97
|
console.log(message);
|
|
96
98
|
}, "getWeiboAndSendMessageToGroup");
|
|
97
99
|
var getLastPost = /* @__PURE__ */ __name((params, weiboList) => {
|
|
@@ -163,7 +165,7 @@ var getMessage = /* @__PURE__ */ __name((params, wbPost) => {
|
|
|
163
165
|
return { post: wbpost, islast: true };
|
|
164
166
|
}, "getMessage");
|
|
165
167
|
var getWeibo = /* @__PURE__ */ __name(async (config, callback) => {
|
|
166
|
-
const { weiboUID } = config;
|
|
168
|
+
const { weiboUID, cookie } = config;
|
|
167
169
|
if (!weiboUID) {
|
|
168
170
|
return;
|
|
169
171
|
}
|
|
@@ -171,13 +173,12 @@ var getWeibo = /* @__PURE__ */ __name(async (config, callback) => {
|
|
|
171
173
|
"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",
|
|
172
174
|
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
|
173
175
|
"cache-control": "no-cache",
|
|
174
|
-
"cookie":
|
|
175
|
-
"referer": "https://
|
|
176
|
-
"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"
|
|
177
|
-
"x-xsrf-token": "mgVY3WMp8U-T6Wbu24ifdazm"
|
|
176
|
+
"cookie": cookie,
|
|
177
|
+
"referer": "https://www.weibo.com/u/7730797357",
|
|
178
|
+
"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"
|
|
178
179
|
};
|
|
179
180
|
const options = {
|
|
180
|
-
hostname: "weibo.com",
|
|
181
|
+
hostname: "www.weibo.com",
|
|
181
182
|
path: "/ajax/statuses/mymblog?uid=" + weiboUID,
|
|
182
183
|
method: "GET",
|
|
183
184
|
headers
|
package/package.json
CHANGED