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.
Files changed (2) hide show
  1. package/lib/index.js +7 -6
  2. 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": "XSRF-TOKEN=mgVY3WMp8U-T6Wbu24ifdazm; SUBP=0033WrSXqPxfM72-Ws9jqgMF55529P9D9WhizH8r9Hyn870HzJo4TQoB; SUB=_2AkMSf_1df8NxqwJRmfATxWrlaIV_ywjEieKkIwyGJRMxHRl-yj8XqksbtRB6Of_Tsj1wFglssEkNvyqikP19B0UlIrd8; WBPSESS=NcA3pTjBP9SOtpsXaAXWlx_1aL3IfVadLkk5h-hKiZrhJi_NyNc2r5RbB0ZE0gYuG6ZSJmF8k26JJ46ltyme0fAcMSF9VPonnDU1TPvBjVADJPPa99vi0TVPQDCUKIMU",
175
- "referer": "https://passport.weibo.com/",
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-weibo-post-monitor",
3
3
  "description": "微博帖子更新推送插件,用于获取指定微博用户的最新帖子推送到指定群聊,参考代码https://github.com/moehuhu/weibo-monitor",
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [