browserpaw 0.0.0-stage → 5.0.1
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/LICENSE +681 -0
- package/README.md +4 -2
- package/dist/v5/cli-files.cjs +147 -0
- package/dist/v5/cli.cjs +4900 -0
- package/dist/v5/extension/assets/popup-Djl4pI1R.css +359 -0
- package/dist/v5/extension/background.js +39389 -0
- package/dist/v5/extension/browserpaw-build.json +191 -0
- package/dist/v5/extension/chunks/popup-BSqTH70w.js +6575 -0
- package/dist/v5/extension/content-scripts/agent-cursor.js +1475 -0
- package/dist/v5/extension/icon/128.png +0 -0
- package/dist/v5/extension/icon/16.png +0 -0
- package/dist/v5/extension/icon/32.png +0 -0
- package/dist/v5/extension/icon/48.png +0 -0
- package/dist/v5/extension/icon/96.png +0 -0
- package/dist/v5/extension/images/cursor-chat.png +0 -0
- package/dist/v5/extension/inject-scripts/accessibility-tree-helper.js +2031 -0
- package/dist/v5/extension/inject-scripts/keyboard-helper.js +412 -0
- package/dist/v5/extension/inject-scripts/network-helper.js +378 -0
- package/dist/v5/extension/inject-scripts/screenshot-helper.js +449 -0
- package/dist/v5/extension/inpage-engine.js +9437 -0
- package/dist/v5/extension/manifest.json +1 -0
- package/dist/v5/extension/popup.html +14 -0
- package/dist/v5/host.cjs +19813 -0
- package/dist/v5/recipes/bilibili-popular-videos.json +364 -0
- package/dist/v5/recipes/bilibili-video-detail.json +395 -0
- package/dist/v5/recipes/developer.mozilla.org.md +15 -0
- package/dist/v5/recipes/github-issue-thread.json +313 -0
- package/dist/v5/recipes/github-releases.json +218 -0
- package/dist/v5/recipes/github-repo-readme.json +306 -0
- package/dist/v5/recipes/github-repo-search.json +313 -0
- package/dist/v5/recipes/mdn-search.json +219 -0
- package/dist/v5/recipes/npm-compare.json +458 -0
- package/dist/v5/recipes/reddit-post-read.json +289 -0
- package/dist/v5/recipes/reddit-subreddit-posts.json +331 -0
- package/dist/v5/recipes/v2ex-node-topics.json +334 -0
- package/dist/v5/recipes/v2ex-topic-read.json +325 -0
- package/dist/v5/recipes/x-profile-posts.json +332 -0
- package/dist/v5/recipes/x-search-thread.json +293 -0
- package/dist/v5/recipes/x-visible-thread.json +260 -0
- package/dist/v5/recipes/youtube-search-videos.json +279 -0
- package/dist/v5/recipes/youtube-video-read.json +349 -0
- package/dist/v5/run_host.bat +7 -0
- package/dist/v5/run_host.sh +6 -0
- package/dist/v5/skill/browserpaw/SKILL.md +48 -0
- package/dist/v5/skill/browserpaw/assets/recipes/bilibili-popular-videos.json +364 -0
- package/dist/v5/skill/browserpaw/assets/recipes/bilibili-video-detail.json +395 -0
- package/dist/v5/skill/browserpaw/assets/recipes/developer.mozilla.org.md +15 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-issue-thread.json +313 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-releases.json +218 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-repo-readme.json +306 -0
- package/dist/v5/skill/browserpaw/assets/recipes/github-repo-search.json +313 -0
- package/dist/v5/skill/browserpaw/assets/recipes/mdn-search.json +219 -0
- package/dist/v5/skill/browserpaw/assets/recipes/npm-compare.json +458 -0
- package/dist/v5/skill/browserpaw/assets/recipes/reddit-post-read.json +289 -0
- package/dist/v5/skill/browserpaw/assets/recipes/reddit-subreddit-posts.json +331 -0
- package/dist/v5/skill/browserpaw/assets/recipes/v2ex-node-topics.json +334 -0
- package/dist/v5/skill/browserpaw/assets/recipes/v2ex-topic-read.json +325 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-profile-posts.json +332 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-search-thread.json +293 -0
- package/dist/v5/skill/browserpaw/assets/recipes/x-visible-thread.json +260 -0
- package/dist/v5/skill/browserpaw/assets/recipes/youtube-search-videos.json +279 -0
- package/dist/v5/skill/browserpaw/assets/recipes/youtube-video-read.json +349 -0
- package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.md +7 -0
- package/dist/v5/skill/browserpaw/references/TROUBLESHOOTING.zh-CN.md +5 -0
- package/dist/v5/skill/browserpaw/references/browser-data.md +33 -0
- package/dist/v5/skill/browserpaw/references/commands.md +103 -0
- package/dist/v5/skill/browserpaw/references/debugging.md +32 -0
- package/dist/v5/skill/browserpaw/references/recipe-contract.md +47 -0
- package/package.json +67 -4
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "x-profile-posts",
|
|
3
|
+
"name": "X profile and visible posts reader",
|
|
4
|
+
"description": "Read an X account's visible profile summary and bounded recent posts in Chrome; detects login walls and loading timeouts cleanly without fabricating posts.",
|
|
5
|
+
"source": {
|
|
6
|
+
"type": "builtin",
|
|
7
|
+
"urls": [
|
|
8
|
+
"https://x.com/github",
|
|
9
|
+
"https://x.com/reactjs"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"domains": [
|
|
13
|
+
"x.com",
|
|
14
|
+
"twitter.com"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"x",
|
|
18
|
+
"twitter",
|
|
19
|
+
"profile",
|
|
20
|
+
"tweets",
|
|
21
|
+
"user",
|
|
22
|
+
"posts",
|
|
23
|
+
"timeline",
|
|
24
|
+
"主页",
|
|
25
|
+
"推特主页",
|
|
26
|
+
"推特博主",
|
|
27
|
+
"用户推文",
|
|
28
|
+
"X主页"
|
|
29
|
+
],
|
|
30
|
+
"startUrl": "https://x.com/{{username}}",
|
|
31
|
+
"inputSchema": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"username": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "X username without leading @",
|
|
37
|
+
"pattern": "^[A-Za-z0-9_]{1,15}$"
|
|
38
|
+
},
|
|
39
|
+
"limit": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"minimum": 1,
|
|
42
|
+
"maximum": 20,
|
|
43
|
+
"default": 8
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": [
|
|
47
|
+
"username"
|
|
48
|
+
],
|
|
49
|
+
"additionalProperties": false
|
|
50
|
+
},
|
|
51
|
+
"outputSchema": {
|
|
52
|
+
"oneOf": [
|
|
53
|
+
{
|
|
54
|
+
"type": "object",
|
|
55
|
+
"properties": {
|
|
56
|
+
"success": {
|
|
57
|
+
"const": true
|
|
58
|
+
},
|
|
59
|
+
"status": {
|
|
60
|
+
"const": "ok"
|
|
61
|
+
},
|
|
62
|
+
"coverage": {
|
|
63
|
+
"const": "visible_only"
|
|
64
|
+
},
|
|
65
|
+
"profile": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"username": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"minLength": 1
|
|
71
|
+
},
|
|
72
|
+
"displayName": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"bio": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"url": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"pattern": "^https://(?:x|twitter)\\.com/[A-Za-z0-9_]{1,15}$"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"required": [
|
|
84
|
+
"username",
|
|
85
|
+
"displayName",
|
|
86
|
+
"bio",
|
|
87
|
+
"url"
|
|
88
|
+
],
|
|
89
|
+
"additionalProperties": false
|
|
90
|
+
},
|
|
91
|
+
"posts": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"minItems": 1,
|
|
94
|
+
"maxItems": 20,
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"text": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1
|
|
101
|
+
},
|
|
102
|
+
"author": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"url": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"pattern": "^https://(?:x|twitter)\\.com/.+/status/\\d+"
|
|
108
|
+
},
|
|
109
|
+
"publishedAt": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"required": [
|
|
114
|
+
"text",
|
|
115
|
+
"author",
|
|
116
|
+
"url",
|
|
117
|
+
"publishedAt"
|
|
118
|
+
],
|
|
119
|
+
"additionalProperties": false
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"sources": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"properties": {
|
|
125
|
+
"page": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"pattern": "^https://(?:x|twitter)\\.com/"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"page"
|
|
132
|
+
],
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": [
|
|
137
|
+
"success",
|
|
138
|
+
"status",
|
|
139
|
+
"coverage",
|
|
140
|
+
"profile",
|
|
141
|
+
"posts",
|
|
142
|
+
"sources"
|
|
143
|
+
],
|
|
144
|
+
"additionalProperties": false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {
|
|
149
|
+
"success": {
|
|
150
|
+
"const": true
|
|
151
|
+
},
|
|
152
|
+
"status": {
|
|
153
|
+
"const": "empty"
|
|
154
|
+
},
|
|
155
|
+
"coverage": {
|
|
156
|
+
"const": "visible_only"
|
|
157
|
+
},
|
|
158
|
+
"profile": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"properties": {
|
|
161
|
+
"username": {
|
|
162
|
+
"type": "string",
|
|
163
|
+
"minLength": 1
|
|
164
|
+
},
|
|
165
|
+
"displayName": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"bio": {
|
|
169
|
+
"type": "string"
|
|
170
|
+
},
|
|
171
|
+
"url": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"pattern": "^https://(?:x|twitter)\\.com/[A-Za-z0-9_]{1,15}$"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": [
|
|
177
|
+
"username",
|
|
178
|
+
"displayName",
|
|
179
|
+
"bio",
|
|
180
|
+
"url"
|
|
181
|
+
],
|
|
182
|
+
"additionalProperties": false
|
|
183
|
+
},
|
|
184
|
+
"posts": {
|
|
185
|
+
"type": "array",
|
|
186
|
+
"minItems": 0,
|
|
187
|
+
"maxItems": 0
|
|
188
|
+
},
|
|
189
|
+
"sources": {
|
|
190
|
+
"type": "object",
|
|
191
|
+
"properties": {
|
|
192
|
+
"page": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"pattern": "^https://(?:x|twitter)\\.com/"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"required": [
|
|
198
|
+
"page"
|
|
199
|
+
],
|
|
200
|
+
"additionalProperties": false
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": [
|
|
204
|
+
"success",
|
|
205
|
+
"status",
|
|
206
|
+
"coverage",
|
|
207
|
+
"profile",
|
|
208
|
+
"posts",
|
|
209
|
+
"sources"
|
|
210
|
+
],
|
|
211
|
+
"additionalProperties": false
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
"steps": [
|
|
216
|
+
{
|
|
217
|
+
"tool": "chrome_javascript",
|
|
218
|
+
"args": {
|
|
219
|
+
"code": "const username = String(input.username || '').trim().replace(/^@/, '');\nconst limit = Math.max(1, Math.min(Number(input.limit) || 8, 20));\nconst canonicalPageUrl = 'https://x.com/' + encodeURIComponent(username);\nconst origin = typeof location !== 'undefined' && typeof location.origin === 'string' && /^https:\\/\\/(?:mobile\\.)?(?:x|twitter)\\.com$/i.test(location.origin) ? location.origin : '';\nif (!origin) {\n return { success: false, status: 'page_not_ready', requiresLogin: false, message: 'X profile page origin is not ready', username, source: canonicalPageUrl };\n}\nconst canonicalOrigin = origin.replace(/^https:\\/\\/mobile\\./i, 'https://');\nconst source = new URL('/' + encodeURIComponent(username), 'https://x.com');\nconst loginPath = /^\\/(?:i\\/flow\\/login|login)(?:\\/|$)/.test(String(location.pathname || ''));\nconst isVisible = element => {\n if (!element || !element.getBoundingClientRect) return false;\n if (element.hidden === true) return false;\n if (typeof element.getAttribute === 'function') {\n if (element.getAttribute('aria-hidden') === 'true') return false;\n const hiddenAttr = element.getAttribute('hidden');\n if (hiddenAttr !== null && hiddenAttr !== undefined) return false;\n }\n if (element.style && (element.style.display === 'none' || element.style.visibility === 'hidden')) return false;\n const rect = element.getBoundingClientRect();\n const style = typeof getComputedStyle === 'function' ? getComputedStyle(element) : null;\n return Boolean(rect) && rect.width > 0 && rect.height > 0 && (!style || (style.display !== 'none' && style.visibility !== 'hidden'));\n};\nconst isArticleVisible = element => {\n if (!element) return false;\n if (element.hidden === true) return false;\n if (typeof element.getAttribute === 'function') {\n if (element.getAttribute('aria-hidden') === 'true') return false;\n const hiddenAttr = element.getAttribute('hidden');\n if (hiddenAttr !== null && hiddenAttr !== undefined) return false;\n }\n if (element.style && (element.style.display === 'none' || element.style.visibility === 'hidden')) return false;\n const style = typeof getComputedStyle === 'function' ? getComputedStyle(element) : null;\n if (style && (style.display === 'none' || style.visibility === 'hidden')) return false;\n if (typeof element.getBoundingClientRect === 'function') {\n const rect = element.getBoundingClientRect();\n if (!rect || rect.width <= 0 || rect.height <= 0) return false;\n }\n return true;\n};\nconst hasVisibleLoginForm = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelectorAll !== 'function') return false;\n return Array.from(document.querySelectorAll('form')).some(form =>\n isVisible(form) && Array.from(form.querySelectorAll('input[autocomplete=\"username\"], input[name=\"text\"], input[type=\"password\"]')).some(isVisible)\n );\n};\nconst hasEmptyProfileState = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelector !== 'function') return false;\n const el = document.querySelector('main [data-testid=\"emptyState\"]') || document.querySelector('[data-testid=\"emptyState\"]');\n if (!isVisible(el)) return false;\n const text = String(el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim().toLowerCase();\n return text.includes(\"hasn't posted\") || text.includes(\"haven't posted\") || text.includes('还没有发帖') || text.includes('尚未发布');\n};\nconst hasMissingAccount = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelector !== 'function') return false;\n const el = document.querySelector('main [data-testid=\"emptyState\"]') || document.querySelector('[data-testid=\"emptyState\"]');\n if (!isVisible(el)) return false;\n const text = String(el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim().toLowerCase();\n return text.includes(\"account doesn't exist\") || text.includes('此账号不存在') || text.includes('account suspended');\n};\nconst queryArticles = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelectorAll !== 'function') return [];\n const primary = Array.from(document.querySelectorAll('article[data-testid=\"tweet\"]'));\n return primary.length ? primary : Array.from(document.querySelectorAll('article'));\n};\nconst isInsideQuote = (article, el) => {\n if (!el || typeof el.closest !== 'function') return false;\n const quoteWrap = el.closest('div[role=\"link\"], [data-testid=\"quoteTweet\"], [data-testid=\"card.wrapper\"]');\n if (quoteWrap && quoteWrap !== article && (typeof article.contains !== 'function' || article.contains(quoteWrap))) return true;\n const nestedArticle = el.closest('article');\n return Boolean(nestedArticle && nestedArticle !== article);\n};\nconst isPromoted = article => {\n if (!article) return false;\n if (typeof article.closest === 'function' && article.closest('[data-testid=\"placementTracking\"]')) return true;\n if (typeof article.querySelector === 'function') {\n if (article.querySelector('[data-testid=\"placementTracking\"]')) return true;\n const social = article.querySelector('[data-testid=\"socialContext\"], [data-testid=\"SocialContext\"]');\n if (social && !isInsideQuote(article, social)) {\n const sText = String(social.innerText || social.textContent || '').trim();\n if (/\\b(?:promoted|sponsored|ad)\\b|推广|广告/i.test(sText)) return true;\n }\n }\n if (typeof article.querySelectorAll === 'function') {\n const spans = Array.from(article.querySelectorAll('span'));\n if (spans.some(sp => {\n if (typeof sp.closest === 'function' && sp.closest('[data-testid=\"tweetText\"], [data-testid=\"User-Name\"]')) return false;\n if (isInsideQuote(article, sp)) return false;\n const t = String(sp.innerText || sp.textContent || '').trim();\n return /^(?:Ad|Promoted|Sponsored|广告|推广)$/i.test(t);\n })) return true;\n }\n return false;\n};\nconst isRepost = (article, statusAuthor) => {\n const social = article && typeof article.querySelector === 'function'\n ? article.querySelector('[data-testid=\"socialContext\"], [data-testid=\"SocialContext\"]')\n : null;\n if (social && !isInsideQuote(article, social)) {\n const sText = String(social.innerText || social.textContent || '').trim();\n if (/\\b(?:reposted|retweeted)\\b|转推|转帖/i.test(sText)) return true;\n if (/\\bpinned\\b|置顶/i.test(sText)) return Boolean(statusAuthor && statusAuthor.toLowerCase() !== username.toLowerCase());\n }\n return Boolean(statusAuthor && statusAuthor.toLowerCase() !== username.toLowerCase());\n};\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms));\nlet articles = [];\nlet loginForm = false;\nlet emptyState = false;\nlet missingAccount = false;\nfor (let attempt = 0; attempt < 40; attempt += 1) {\n if (loginPath) break;\n articles = queryArticles().filter(article => isArticleVisible(article) && !isPromoted(article));\n if (articles.length) break;\n loginForm = hasVisibleLoginForm();\n if (loginForm) break;\n missingAccount = hasMissingAccount();\n if (missingAccount) break;\n emptyState = hasEmptyProfileState();\n if (emptyState) break;\n if (attempt < 39) await sleep(250);\n}\nif (loginPath || loginForm) {\n return { success: false, status: 'requires_auth', requiresLogin: true, message: 'X requires authentication to read this profile', username, source: source.href };\n}\nif (missingAccount) {\n return { success: false, status: 'not_found', requiresLogin: false, message: 'X account does not exist or is suspended', username, source: source.href };\n}\nconst nameEl = typeof document !== 'undefined' && document && typeof document.querySelector === 'function' ? document.querySelector('[data-testid=\"UserName\"]') : null;\nconst bioEl = typeof document !== 'undefined' && document && typeof document.querySelector === 'function' ? document.querySelector('[data-testid=\"UserDescription\"]') : null;\nconst displayName = String((nameEl && (nameEl.innerText || nameEl.textContent)) || '').split('\\n').map(v => v.trim()).find(Boolean) || username;\nconst bio = String((bioEl && (bioEl.innerText || bioEl.textContent)) || '').trim().slice(0, 600);\nconst profile = { username, displayName, bio, url: source.href };\nif (emptyState) {\n return { success: true, status: 'empty', coverage: 'visible_only', profile, posts: [], sources: { page: source.href } };\n}\nif (!articles.length) {\n return { success: false, status: 'loading_timeout', requiresLogin: false, message: 'X profile posts did not become visible within 10 seconds', username, source: source.href };\n}\nconst mainStatusLink = article => {\n const links = typeof article.querySelectorAll === 'function' ? Array.from(article.querySelectorAll('a:has(time)')) : [];\n const candidates = links.filter(link => !isInsideQuote(article, link));\n const pool = candidates.length ? candidates : links;\n return pool.find(link => {\n const href = link.getAttribute('href') || '';\n try {\n return /^\\/[^/]+\\/status\\/\\d+$/.test(new URL(href, canonicalOrigin).pathname);\n } catch {\n return false;\n }\n });\n};\nconst firstPrimaryEl = (article, selector) => {\n const list = typeof article.querySelectorAll === 'function' ? Array.from(article.querySelectorAll(selector)) : [];\n if (list.length) return list.find(el => !isInsideQuote(article, el)) || null;\n const single = typeof article.querySelector === 'function' ? article.querySelector(selector) : null;\n return single && !isInsideQuote(article, single) ? single : null;\n};\nconst posts = articles.map(article => {\n const statusLink = mainStatusLink(article);\n const href = statusLink ? statusLink.getAttribute('href') || '' : '';\n const statusUrl = href ? new URL(href, canonicalOrigin).href : '';\n const statusAuthorMatch = statusUrl ? new URL(statusUrl).pathname.match(/^\\/([^/]+)\\/status\\/\\d+$/) : null;\n const statusAuthor = statusAuthorMatch ? statusAuthorMatch[1] : '';\n if (isRepost(article, statusAuthor)) return null;\n const textEl = firstPrimaryEl(article, '[data-testid=\"tweetText\"]');\n const text = String((textEl && (textEl.innerText || textEl.textContent)) || '').trim();\n const userEl = firstPrimaryEl(article, '[data-testid=\"User-Name\"]');\n const nameBlock = String((userEl && (userEl.innerText || userEl.textContent)) || '').trim();\n const author = nameBlock.split('\\n').map(part => part.trim()).find(Boolean) || (statusAuthor ? '@' + statusAuthor : '');\n const time = statusLink && typeof statusLink.querySelector === 'function' ? statusLink.querySelector('time') : null;\n return {\n text,\n author,\n url: statusUrl,\n publishedAt: time ? String(time.getAttribute('datetime') || '') : ''\n };\n}).filter(post => post && post.text && post.url).slice(0, limit);\nif (!posts.length) {\n return { success: false, status: 'unreadable', requiresLogin: false, message: 'Visible X profile articles did not expose readable text and status links', username, source: source.href };\n}\nreturn { success: true, status: 'ok', coverage: 'visible_only', profile, posts, sources: { page: source.href } };",
|
|
220
|
+
"timeoutMs": 20000
|
|
221
|
+
},
|
|
222
|
+
"resultPath": "/result"
|
|
223
|
+
}
|
|
224
|
+
],
|
|
225
|
+
"verification": {
|
|
226
|
+
"tool": "chrome_read_dom",
|
|
227
|
+
"args": {
|
|
228
|
+
"format": "compact",
|
|
229
|
+
"selector": "main",
|
|
230
|
+
"activeViewportOnly": false,
|
|
231
|
+
"limit": 80,
|
|
232
|
+
"maxTextLength": 240
|
|
233
|
+
},
|
|
234
|
+
"resultPath": "/treeString"
|
|
235
|
+
},
|
|
236
|
+
"tests": [
|
|
237
|
+
{
|
|
238
|
+
"inputs": {
|
|
239
|
+
"username": "github",
|
|
240
|
+
"limit": 5
|
|
241
|
+
},
|
|
242
|
+
"expect": {
|
|
243
|
+
"type": "object",
|
|
244
|
+
"properties": {
|
|
245
|
+
"success": {
|
|
246
|
+
"const": true
|
|
247
|
+
},
|
|
248
|
+
"status": {
|
|
249
|
+
"const": "ok"
|
|
250
|
+
},
|
|
251
|
+
"coverage": {
|
|
252
|
+
"const": "visible_only"
|
|
253
|
+
},
|
|
254
|
+
"profile": {
|
|
255
|
+
"type": "object",
|
|
256
|
+
"properties": {
|
|
257
|
+
"username": {
|
|
258
|
+
"const": "github"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"required": [
|
|
262
|
+
"username"
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
"posts": {
|
|
266
|
+
"type": "array",
|
|
267
|
+
"minItems": 1
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": [
|
|
271
|
+
"success",
|
|
272
|
+
"status",
|
|
273
|
+
"coverage",
|
|
274
|
+
"profile",
|
|
275
|
+
"posts",
|
|
276
|
+
"sources"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"observe": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"pattern": "github|GitHub|Posts|Log in|Sign in"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"inputs": {
|
|
286
|
+
"username": "reactjs",
|
|
287
|
+
"limit": 3
|
|
288
|
+
},
|
|
289
|
+
"expect": {
|
|
290
|
+
"type": "object",
|
|
291
|
+
"properties": {
|
|
292
|
+
"success": {
|
|
293
|
+
"const": true
|
|
294
|
+
},
|
|
295
|
+
"status": {
|
|
296
|
+
"const": "ok"
|
|
297
|
+
},
|
|
298
|
+
"coverage": {
|
|
299
|
+
"const": "visible_only"
|
|
300
|
+
},
|
|
301
|
+
"profile": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"properties": {
|
|
304
|
+
"username": {
|
|
305
|
+
"const": "reactjs"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"required": [
|
|
309
|
+
"username"
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
"posts": {
|
|
313
|
+
"type": "array",
|
|
314
|
+
"minItems": 1
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
"required": [
|
|
318
|
+
"success",
|
|
319
|
+
"status",
|
|
320
|
+
"coverage",
|
|
321
|
+
"profile",
|
|
322
|
+
"posts",
|
|
323
|
+
"sources"
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
"observe": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"pattern": "react|React|Posts|Log in|Sign in"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "x-search-thread",
|
|
3
|
+
"name": "X search results reader",
|
|
4
|
+
"description": "Read visible X search results and return source-linked posts; this recipe does not read a full conversation thread. It waits briefly for the authenticated search timeline, returns an explicit empty result only for recognized no-results text, and reports loading_timeout instead of treating transient login text as authentication failure.",
|
|
5
|
+
"source": {
|
|
6
|
+
"type": "builtin",
|
|
7
|
+
"urls": [
|
|
8
|
+
"https://x.com/search?q=fetch&src=typed_query&f=live",
|
|
9
|
+
"https://help.x.com/en/using-x/x-search"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"domains": [
|
|
13
|
+
"x.com",
|
|
14
|
+
"twitter.com"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"x",
|
|
18
|
+
"twitter",
|
|
19
|
+
"search",
|
|
20
|
+
"posts",
|
|
21
|
+
"推特",
|
|
22
|
+
"推文",
|
|
23
|
+
"推特搜索",
|
|
24
|
+
"搜索推文",
|
|
25
|
+
"X搜索"
|
|
26
|
+
],
|
|
27
|
+
"startUrl": "https://x.com/search?q={{query}}&src=typed_query&f=live",
|
|
28
|
+
"inputSchema": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"query": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1,
|
|
34
|
+
"maxLength": 200
|
|
35
|
+
},
|
|
36
|
+
"limit": {
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"minimum": 1,
|
|
39
|
+
"maximum": 20,
|
|
40
|
+
"default": 8
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"query"
|
|
45
|
+
],
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"outputSchema": {
|
|
49
|
+
"oneOf": [
|
|
50
|
+
{
|
|
51
|
+
"type": "object",
|
|
52
|
+
"properties": {
|
|
53
|
+
"success": {
|
|
54
|
+
"const": true
|
|
55
|
+
},
|
|
56
|
+
"status": {
|
|
57
|
+
"const": "ok"
|
|
58
|
+
},
|
|
59
|
+
"coverage": {
|
|
60
|
+
"const": "visible_only"
|
|
61
|
+
},
|
|
62
|
+
"query": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
},
|
|
66
|
+
"posts": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"maxItems": 20,
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"text": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"minLength": 1
|
|
76
|
+
},
|
|
77
|
+
"author": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"url": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^https://(?:x|twitter)\\.com/.+/status/\\d+"
|
|
83
|
+
},
|
|
84
|
+
"publishedAt": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"required": [
|
|
89
|
+
"text",
|
|
90
|
+
"author",
|
|
91
|
+
"url",
|
|
92
|
+
"publishedAt"
|
|
93
|
+
],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"sources": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"properties": {
|
|
100
|
+
"page": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"pattern": "^https://(?:x|twitter)\\.com/"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": [
|
|
106
|
+
"page"
|
|
107
|
+
],
|
|
108
|
+
"additionalProperties": false
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": [
|
|
112
|
+
"success",
|
|
113
|
+
"status",
|
|
114
|
+
"query",
|
|
115
|
+
"posts",
|
|
116
|
+
"sources"
|
|
117
|
+
],
|
|
118
|
+
"additionalProperties": false
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"success": {
|
|
124
|
+
"const": true
|
|
125
|
+
},
|
|
126
|
+
"status": {
|
|
127
|
+
"const": "empty"
|
|
128
|
+
},
|
|
129
|
+
"coverage": {
|
|
130
|
+
"const": "visible_only"
|
|
131
|
+
},
|
|
132
|
+
"query": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"minLength": 1
|
|
135
|
+
},
|
|
136
|
+
"posts": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"minItems": 0,
|
|
139
|
+
"maxItems": 0
|
|
140
|
+
},
|
|
141
|
+
"sources": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"page": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"pattern": "^https://(?:x|twitter)\\.com/"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"required": [
|
|
150
|
+
"page"
|
|
151
|
+
],
|
|
152
|
+
"additionalProperties": false
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"required": [
|
|
156
|
+
"success",
|
|
157
|
+
"status",
|
|
158
|
+
"query",
|
|
159
|
+
"posts",
|
|
160
|
+
"sources"
|
|
161
|
+
],
|
|
162
|
+
"additionalProperties": false
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"steps": [
|
|
167
|
+
{
|
|
168
|
+
"tool": "chrome_javascript",
|
|
169
|
+
"args": {
|
|
170
|
+
"code": "const query = String(input.query || '').trim();\nconst limit = Math.max(1, Math.min(Number(input.limit) || 8, 20));\nconst fallbackSource = new URL('/search', 'https://x.com');\nfallbackSource.searchParams.set('q', query);\nfallbackSource.searchParams.set('src', 'typed_query');\nfallbackSource.searchParams.set('f', 'live');\nconst origin = typeof location !== 'undefined' && typeof location.origin === 'string' && /^https:\\/\\/(?:mobile\\.)?(?:x|twitter)\\.com$/i.test(location.origin) ? location.origin : '';\nif (!origin) {\n return {\n success: false,\n status: 'page_not_ready',\n requiresLogin: false,\n message: 'X search page origin is not ready',\n query,\n source: fallbackSource.href\n };\n}\nconst canonicalOrigin = origin.replace(/^https:\\/\\/mobile\\./i, 'https://');\nconst source = new URL('/search', canonicalOrigin);\nsource.searchParams.set('q', query);\nsource.searchParams.set('src', 'typed_query');\nsource.searchParams.set('f', 'live');\nconst loginPath = /^\\/(?:i\\/flow\\/login|login)(?:\\/|$)/.test(String(location.pathname || ''));\nconst isVisible = element => {\n if (!element || !element.getBoundingClientRect) return false;\n if (element.hidden === true) return false;\n if (typeof element.getAttribute === 'function') {\n if (element.getAttribute('aria-hidden') === 'true') return false;\n const hiddenAttr = element.getAttribute('hidden');\n if (hiddenAttr !== null && hiddenAttr !== undefined) return false;\n }\n if (element.style && (element.style.display === 'none' || element.style.visibility === 'hidden')) return false;\n const rect = element.getBoundingClientRect();\n const style = typeof getComputedStyle === 'function' ? getComputedStyle(element) : null;\n return Boolean(rect) && rect.width > 0 && rect.height > 0 && (!style || (style.display !== 'none' && style.visibility !== 'hidden'));\n};\nconst isArticleVisible = element => {\n if (!element) return false;\n if (element.hidden === true) return false;\n if (typeof element.getAttribute === 'function') {\n if (element.getAttribute('aria-hidden') === 'true') return false;\n const hiddenAttr = element.getAttribute('hidden');\n if (hiddenAttr !== null && hiddenAttr !== undefined) return false;\n }\n if (element.style && (element.style.display === 'none' || element.style.visibility === 'hidden')) return false;\n const style = typeof getComputedStyle === 'function' ? getComputedStyle(element) : null;\n if (style && (style.display === 'none' || style.visibility === 'hidden')) return false;\n if (typeof element.getBoundingClientRect === 'function') {\n const rect = element.getBoundingClientRect();\n if (!rect || rect.width <= 0 || rect.height <= 0) return false;\n }\n return true;\n};\nconst hasVisibleLoginForm = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelectorAll !== 'function') return false;\n return Array.from(document.querySelectorAll('form')).some(form =>\n isVisible(form) && Array.from(form.querySelectorAll('input[autocomplete=\"username\"], input[name=\"text\"], input[type=\"password\"]')).some(isVisible)\n );\n};\nconst hasExplicitEmptyState = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelector !== 'function') return false;\n const element = document.querySelector('main [data-testid=\"emptyState\"]') || document.querySelector('[data-testid=\"emptyState\"]');\n if (!isVisible(element)) return false;\n const normalizeQuotes = value => value.replace(/[“”]/g, '\"').replace(/[‘’]/g, \"'\");\n const text = normalizeQuotes(String(element.innerText || element.textContent || '')).replace(/\\s+/g, ' ').trim().toLowerCase();\n const normalizedQuery = normalizeQuotes(query).replace(/\\s+/g, ' ').trim().toLowerCase();\n if (!normalizedQuery) return false;\n const escaped = normalizedQuery.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const boundaryRe = new RegExp('no results for (?:[\"' + \"'\" + ']' + escaped + '[\"' + \"'\" + ']|' + escaped + '(?=$|[^a-z0-9_]))');\n return (\n boundaryRe.test(text) ||\n text.includes('没有关于\"' + normalizedQuery + '\"的结果') ||\n text.includes(\"没有关于'\" + normalizedQuery + \"'的结果\") ||\n text.includes('沒有關於\"' + normalizedQuery + '\"的結果') ||\n text.includes(\"沒有關於'\" + normalizedQuery + \"'的結果\")\n );\n};\nconst queryArticles = () => {\n if (typeof document === 'undefined' || !document || typeof document.querySelectorAll !== 'function') return [];\n const primary = Array.from(document.querySelectorAll('article[data-testid=\"tweet\"]'));\n return primary.length ? primary : Array.from(document.querySelectorAll('article'));\n};\nconst isInsideQuote = (article, el) => {\n if (!el || typeof el.closest !== 'function') return false;\n const quoteWrap = el.closest('div[role=\"link\"], [data-testid=\"quoteTweet\"], [data-testid=\"card.wrapper\"]');\n if (quoteWrap && quoteWrap !== article && (typeof article.contains !== 'function' || article.contains(quoteWrap))) return true;\n const nestedArticle = el.closest('article');\n return Boolean(nestedArticle && nestedArticle !== article);\n};\nconst isPromoted = article => {\n if (!article) return false;\n if (typeof article.closest === 'function' && article.closest('[data-testid=\"placementTracking\"]')) return true;\n if (typeof article.querySelector === 'function') {\n if (article.querySelector('[data-testid=\"placementTracking\"]')) return true;\n const social = article.querySelector('[data-testid=\"socialContext\"], [data-testid=\"SocialContext\"]');\n if (social && !isInsideQuote(article, social)) {\n const sText = String(social.innerText || social.textContent || '').trim();\n if (/\\b(?:promoted|sponsored|ad)\\b|推广|广告/i.test(sText)) return true;\n }\n }\n if (typeof article.querySelectorAll === 'function') {\n const spans = Array.from(article.querySelectorAll('span'));\n if (spans.some(sp => {\n if (typeof sp.closest === 'function' && sp.closest('[data-testid=\"tweetText\"], [data-testid=\"User-Name\"]')) return false;\n if (isInsideQuote(article, sp)) return false;\n const t = String(sp.innerText || sp.textContent || '').trim();\n return /^(?:Ad|Promoted|Sponsored|广告|推广)$/i.test(t);\n })) return true;\n }\n return false;\n};\nconst sleep = ms => new Promise(resolve => setTimeout(resolve, ms));\nlet articles = [];\nlet loginForm = false;\nlet emptyState = false;\nfor (let attempt = 0; attempt < 40; attempt += 1) {\n if (loginPath) break;\n articles = queryArticles().filter(article => isArticleVisible(article) && !isPromoted(article));\n if (articles.length) break;\n loginForm = hasVisibleLoginForm();\n if (loginForm) break;\n emptyState = hasExplicitEmptyState();\n if (emptyState) break;\n if (attempt < 39) await sleep(250);\n}\nif (loginPath || loginForm) {\n return {\n success: false,\n status: 'requires_auth',\n requiresLogin: true,\n message: 'X requires authentication to read this search timeline',\n query,\n source: source.href\n };\n}\nif (emptyState) {\n return { success: true, status: 'empty', query, posts: [], sources: { page: source.href } };\n}\nif (!articles.length) {\n return { success: false, status: 'loading_timeout', requiresLogin: false, message: 'X search articles did not become visible within 10 seconds', query, source: source.href };\n}\nconst mainStatusLink = article => {\n const links = typeof article.querySelectorAll === 'function' ? Array.from(article.querySelectorAll('a:has(time)')) : [];\n const candidates = links.filter(link => !isInsideQuote(article, link));\n const pool = candidates.length ? candidates : links;\n return pool.find(link => {\n const href = link.getAttribute('href') || '';\n try {\n return /^\\/[^/]+\\/status\\/\\d+$/.test(new URL(href, canonicalOrigin).pathname);\n } catch {\n return false;\n }\n });\n};\nconst firstPrimaryEl = (article, selector) => {\n const list = typeof article.querySelectorAll === 'function' ? Array.from(article.querySelectorAll(selector)) : [];\n if (list.length) return list.find(el => !isInsideQuote(article, el)) || null;\n const single = typeof article.querySelector === 'function' ? article.querySelector(selector) : null;\n return single && !isInsideQuote(article, single) ? single : null;\n};\nconst posts = articles.map(article => {\n const textEl = firstPrimaryEl(article, '[data-testid=\"tweetText\"]');\n const text = String((textEl && (textEl.innerText || textEl.textContent)) || '').trim();\n const userEl = firstPrimaryEl(article, '[data-testid=\"User-Name\"]');\n const nameBlock = String((userEl && (userEl.innerText || userEl.textContent)) || '').trim();\n const statusLink = mainStatusLink(article);\n const href = statusLink ? statusLink.getAttribute('href') || '' : '';\n const statusUrl = href ? new URL(href, canonicalOrigin).href : '';\n const statusAuthorMatch = statusUrl ? new URL(statusUrl).pathname.match(/^\\/([^/]+)\\/status\\/\\d+$/) : null;\n const handlePart = nameBlock.split('\\n').map(part => part.trim()).find(part => /^@[A-Za-z0-9_]{1,15}$/.test(part));\n const handleInline = !handlePart ? (nameBlock.match(/@[A-Za-z0-9_]{1,15}/) || [])[0] : '';\n const author = handlePart || handleInline || (statusAuthorMatch ? '@' + statusAuthorMatch[1] : '') || nameBlock.split('\\n').map(part => part.trim()).find(Boolean) || '';\n const time = statusLink && typeof statusLink.querySelector === 'function' ? statusLink.querySelector('time') : null;\n return {\n text,\n author,\n url: statusUrl,\n publishedAt: time ? String(time.getAttribute('datetime') || '') : ''\n };\n}).filter(post => post.text && post.url).slice(0, limit);\nif (!posts.length) {\n return { success: false, status: 'unreadable', requiresLogin: false, message: 'Visible X articles did not expose readable text and main status links', query, source: source.href };\n}\nreturn { success: true, status: 'ok', coverage: 'visible_only', query, posts, sources: { page: source.href } };",
|
|
171
|
+
"timeoutMs": 20000
|
|
172
|
+
},
|
|
173
|
+
"resultPath": "/result"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"verification": {
|
|
177
|
+
"tool": "chrome_read_dom",
|
|
178
|
+
"args": {
|
|
179
|
+
"format": "compact",
|
|
180
|
+
"selector": "main",
|
|
181
|
+
"activeViewportOnly": false,
|
|
182
|
+
"limit": 80,
|
|
183
|
+
"maxTextLength": 240
|
|
184
|
+
},
|
|
185
|
+
"resultPath": "/treeString"
|
|
186
|
+
},
|
|
187
|
+
"tests": [
|
|
188
|
+
{
|
|
189
|
+
"inputs": {
|
|
190
|
+
"query": "browser automation",
|
|
191
|
+
"limit": 5
|
|
192
|
+
},
|
|
193
|
+
"expect": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"properties": {
|
|
196
|
+
"query": {
|
|
197
|
+
"const": "browser automation"
|
|
198
|
+
},
|
|
199
|
+
"status": {
|
|
200
|
+
"const": "ok"
|
|
201
|
+
},
|
|
202
|
+
"success": {
|
|
203
|
+
"const": true
|
|
204
|
+
},
|
|
205
|
+
"posts": {
|
|
206
|
+
"type": "array",
|
|
207
|
+
"minItems": 1,
|
|
208
|
+
"items": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"properties": {
|
|
211
|
+
"text": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"minLength": 1
|
|
214
|
+
},
|
|
215
|
+
"url": {
|
|
216
|
+
"type": "string",
|
|
217
|
+
"pattern": "^https://(?:x|twitter)\\.com/.+/status/\\d+"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"required": [
|
|
221
|
+
"text",
|
|
222
|
+
"url"
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"required": [
|
|
228
|
+
"success",
|
|
229
|
+
"status",
|
|
230
|
+
"query",
|
|
231
|
+
"posts"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"observe": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"minLength": 100,
|
|
237
|
+
"pattern": "(?:Post|post|Search|search|status|Log in|Sign in)"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"inputs": {
|
|
242
|
+
"query": "typescript",
|
|
243
|
+
"limit": 3
|
|
244
|
+
},
|
|
245
|
+
"expect": {
|
|
246
|
+
"type": "object",
|
|
247
|
+
"properties": {
|
|
248
|
+
"query": {
|
|
249
|
+
"const": "typescript"
|
|
250
|
+
},
|
|
251
|
+
"status": {
|
|
252
|
+
"const": "ok"
|
|
253
|
+
},
|
|
254
|
+
"success": {
|
|
255
|
+
"const": true
|
|
256
|
+
},
|
|
257
|
+
"posts": {
|
|
258
|
+
"type": "array",
|
|
259
|
+
"minItems": 1,
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"properties": {
|
|
263
|
+
"text": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"minLength": 1
|
|
266
|
+
},
|
|
267
|
+
"url": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"pattern": "^https://(?:x|twitter)\\.com/.+/status/\\d+"
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": [
|
|
273
|
+
"text",
|
|
274
|
+
"url"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"required": [
|
|
280
|
+
"success",
|
|
281
|
+
"status",
|
|
282
|
+
"query",
|
|
283
|
+
"posts"
|
|
284
|
+
]
|
|
285
|
+
},
|
|
286
|
+
"observe": {
|
|
287
|
+
"type": "string",
|
|
288
|
+
"minLength": 100,
|
|
289
|
+
"pattern": "(?:Post|post|Search|search|status|Log in|Sign in)"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
}
|