rsshub 1.0.0-master.f020c43 → 1.0.0-master.f02822e
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.
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Route } from '@/types';
|
|
2
|
+
import ofetch from '@/utils/ofetch';
|
|
3
|
+
import { load } from 'cheerio';
|
|
4
|
+
import { parseDate } from '@/utils/parse-date';
|
|
5
|
+
export const route: Route = {
|
|
6
|
+
path: '/security-bulletin',
|
|
7
|
+
categories: ['program-update'],
|
|
8
|
+
example: '/android/security-bulletin',
|
|
9
|
+
parameters: {},
|
|
10
|
+
features: {
|
|
11
|
+
requireConfig: false,
|
|
12
|
+
requirePuppeteer: false,
|
|
13
|
+
antiCrawler: false,
|
|
14
|
+
supportBT: false,
|
|
15
|
+
supportPodcast: false,
|
|
16
|
+
supportScihub: false,
|
|
17
|
+
},
|
|
18
|
+
radar: [
|
|
19
|
+
{
|
|
20
|
+
source: ['source.android.com/docs/security/bulletin', 'source.android.com/docs/security/bulletin/asb-overview', 'source.android.com/'],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
name: 'Security Bulletins',
|
|
24
|
+
maintainers: ['TonyRL'],
|
|
25
|
+
handler,
|
|
26
|
+
url: 'source.android.com/docs/security/bulletin/asb-overview',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
async function handler() {
|
|
30
|
+
const baseUrl = 'https://source.android.com';
|
|
31
|
+
const link = `${baseUrl}/docs/security/bulletin/asb-overview`;
|
|
32
|
+
|
|
33
|
+
const response = await ofetch(link, {
|
|
34
|
+
headers: {
|
|
35
|
+
Cookie: 'signin=autosignin; cookies_accepted=true; django_language=en;',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const $ = load(response);
|
|
40
|
+
|
|
41
|
+
const items = $('table tr')
|
|
42
|
+
.slice(1)
|
|
43
|
+
.toArray()
|
|
44
|
+
.map((item) => {
|
|
45
|
+
const $item = $(item);
|
|
46
|
+
const a = $item.find('td:nth-child(1) a');
|
|
47
|
+
return {
|
|
48
|
+
title: `Bulletin ${a.text()}`,
|
|
49
|
+
description: $item.find('td:nth-child(2)').html(),
|
|
50
|
+
link: `${baseUrl}${a.attr('href')}`,
|
|
51
|
+
pubDate: parseDate($item.find('td:nth-child(3)').text()),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
title: $('title').text(),
|
|
57
|
+
link,
|
|
58
|
+
image: $('link[rel="apple-touch-icon"]').attr('href'),
|
|
59
|
+
item: items,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -130,10 +130,33 @@ async function handler(ctx) {
|
|
|
130
130
|
)
|
|
131
131
|
);
|
|
132
132
|
|
|
133
|
+
const extractProfileImage = (user: any): string | undefined => {
|
|
134
|
+
if (!user?.profile_image_url || !user?.photo_domain) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const imageUrls = user.profile_image_url.split(',').filter(Boolean);
|
|
139
|
+
if (imageUrls.length === 0) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Priority order for image sizes
|
|
144
|
+
const sizePriority = ['!180x180.png', '!50x50.png', '!30x30.png'];
|
|
145
|
+
|
|
146
|
+
const selectedImageUrl = sizePriority.map((size) => imageUrls.find((url) => url.includes(size))).find(Boolean) || imageUrls[0];
|
|
147
|
+
|
|
148
|
+
const baseDomain = user.photo_domain.startsWith('//') ? `https:${user.photo_domain}` : user.photo_domain;
|
|
149
|
+
|
|
150
|
+
return `${baseDomain}${selectedImageUrl}`;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const profileImage = extractProfileImage(data[0].user);
|
|
154
|
+
|
|
133
155
|
return {
|
|
134
156
|
title: `${data[0].user.screen_name} 的雪球${typename[type]}动态`,
|
|
135
157
|
link,
|
|
136
158
|
description: `${data[0].user.screen_name} 的雪球${typename[type]}动态`,
|
|
159
|
+
image: profileImage,
|
|
137
160
|
item: items,
|
|
138
161
|
};
|
|
139
162
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsshub",
|
|
3
|
-
"version": "1.0.0-master.
|
|
3
|
+
"version": "1.0.0-master.f02822e",
|
|
4
4
|
"description": "Make RSS Great Again!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"RSS"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@postlight/parser": "2.2.3",
|
|
49
49
|
"@rss3/sdk": "0.0.25",
|
|
50
50
|
"@scalar/hono-api-reference": "0.9.3",
|
|
51
|
-
"@sentry/node": "9.
|
|
51
|
+
"@sentry/node": "9.28.0",
|
|
52
52
|
"@tonyrl/rand-user-agent": "2.0.83",
|
|
53
53
|
"aes-js": "3.1.2",
|
|
54
54
|
"art-template": "4.13.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"tldts": "7.0.8",
|
|
112
112
|
"tosource": "2.0.0-alpha.3",
|
|
113
113
|
"tough-cookie": "5.1.2",
|
|
114
|
-
"tsx": "4.
|
|
114
|
+
"tsx": "4.20.0",
|
|
115
115
|
"twitter-api-v2": "1.23.2",
|
|
116
116
|
"ufo": "1.6.1",
|
|
117
117
|
"undici": "6.21.3",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"winston": "3.17.0",
|
|
120
120
|
"xxhash-wasm": "1.1.0",
|
|
121
121
|
"youtubei.js": "14.0.0",
|
|
122
|
-
"zod": "3.25.
|
|
122
|
+
"zod": "3.25.61"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@babel/preset-env": "7.27.2",
|