@superagnt/x-twitter-data 2.0.2 → 2.0.3
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/README.md +10 -11
- package/index.js +53 -265
- package/openclaw.plugin.json +57 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,21 +8,20 @@ Use one API key to pull X data (posts, profiles, and social graph data) for agen
|
|
|
8
8
|
openclaw plugins install @superagnt/x-twitter-data
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This package is the official **OpenClaw** plugin for **X (Twitter)** social and public data via [superagnt](https://superagnt.com). Pair it with the [documentation](https://superagnt.com) and your superagnt API key.
|
|
11
|
+
This package is the official **OpenClaw** plugin for **X (Twitter)** social and public data via [superagnt](https://superagnt.com). Pair it with the [documentation](https://superagnt.com/docs) and your superagnt API key.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Want the live MCP surface instead?
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
the live tool
|
|
17
|
-
|
|
15
|
+
This plugin ships a fixed, baked-in toolset that only needs your
|
|
16
|
+
`SUPERAGNT_API_KEY`. For the live workspace tool surface — the full value
|
|
17
|
+
layer (data sources plus workspace Postgres, schedules, canvases,
|
|
18
|
+
enrichment), growing server-side with no plugin update — install the
|
|
19
|
+
primary superagnt plugin instead:
|
|
18
20
|
|
|
19
21
|
```bash
|
|
20
|
-
|
|
22
|
+
openclaw plugins install @superagnt/superagnt
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
Without the token the plugin uses its built-in toolset with your
|
|
24
|
-
`SUPERAGNT_API_KEY` — no behavior change from previous versions.
|
|
25
|
-
|
|
26
25
|
## Overview
|
|
27
26
|
|
|
28
27
|
Unified access to tweets, user profiles, followers, search, and hashtag streams. Built for LLMs and automation — not one-off scraping.
|
|
@@ -58,8 +57,8 @@ Use a single **superagnt API key** (Bearer token). Set `SUPERAGNT_API_KEY` in yo
|
|
|
58
57
|
|
|
59
58
|
## Documentation
|
|
60
59
|
|
|
61
|
-
- [Documentation](https://superagnt.com) — getting started and concepts
|
|
62
|
-
- [API reference (X (Twitter))](https://superagnt.com/apis/social/x) — endpoints and schemas
|
|
60
|
+
- [Documentation](https://superagnt.com/docs) — getting started and concepts
|
|
61
|
+
- [API reference (X (Twitter))](https://superagnt.com/docs/apis/social/x) — endpoints and schemas
|
|
63
62
|
- [Dashboard](https://app.superagnt.com/dashboard) — API keys and usage
|
|
64
63
|
|
|
65
64
|
## Related
|
package/index.js
CHANGED
|
@@ -28,194 +28,6 @@ function readAgntConfig() {
|
|
|
28
28
|
|
|
29
29
|
// ── End Auth Module ──────────────────────────────────────────────────────────
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
// ── CLI Module (inlined) ─────────────────────────────────────────────────────
|
|
33
|
-
|
|
34
|
-
function maskApiKey(key) {
|
|
35
|
-
if (!key || typeof key !== 'string') return '(none)'
|
|
36
|
-
const k = key.trim()
|
|
37
|
-
if (k.length <= 8) return k.slice(0, 2) + '…'
|
|
38
|
-
return k.slice(0, 6) + '…' + k.slice(-4)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function registerAgntCli(api) {
|
|
42
|
-
api.registerCli(
|
|
43
|
-
({ program }) => {
|
|
44
|
-
const cmd = program
|
|
45
|
-
.command('superagnt')
|
|
46
|
-
.description('superagnt social data API (status, doctor)')
|
|
47
|
-
|
|
48
|
-
cmd
|
|
49
|
-
.command('status')
|
|
50
|
-
.description('Show whether an API key is configured (masked)')
|
|
51
|
-
.action(async () => {
|
|
52
|
-
const cfg = readAgntConfig()
|
|
53
|
-
const key = cfg?.apiKey
|
|
54
|
-
|
|
55
|
-
console.log('\nsuperagnt status\n')
|
|
56
|
-
if (!key) {
|
|
57
|
-
console.log(' API key: not configured')
|
|
58
|
-
console.log(' Workspace: —')
|
|
59
|
-
console.log('\n Get your API key at: https://app.superagnt.com/dashboard\n')
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
console.log(' API key: ' + maskApiKey(key) + ' (from ~/.superagnt/config.json)')
|
|
63
|
-
console.log(' Workspace: ' + (cfg?.workspaceId ?? '—'))
|
|
64
|
-
console.log('')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
cmd
|
|
68
|
-
.command('doctor')
|
|
69
|
-
.description('Check connectivity and validate API key against api.superagnt.dev')
|
|
70
|
-
.action(async () => {
|
|
71
|
-
console.log('\nsuperagnt doctor\n')
|
|
72
|
-
|
|
73
|
-
try {
|
|
74
|
-
const publicRes = await fetch('https://api.superagnt.com/v1/platforms')
|
|
75
|
-
console.log(' Public API: ' + (publicRes.ok ? 'OK (' + publicRes.status + ')' : 'HTTP ' + publicRes.status))
|
|
76
|
-
} catch (err) {
|
|
77
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
78
|
-
console.log(' Public API: failed — ' + msg)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const cfg = readAgntConfig()
|
|
82
|
-
const key = cfg?.apiKey
|
|
83
|
-
|
|
84
|
-
if (!key) {
|
|
85
|
-
console.log('\n Authenticated: skipped (no API key)')
|
|
86
|
-
console.log(' Get your API key at: https://app.superagnt.com/dashboard\n')
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
try {
|
|
91
|
-
const res = await fetch('https://api.superagnt.com/v1/platforms', {
|
|
92
|
-
headers: { Authorization: 'Bearer ' + key },
|
|
93
|
-
})
|
|
94
|
-
const text = await res.text()
|
|
95
|
-
let summary = 'HTTP ' + res.status
|
|
96
|
-
if (res.ok) {
|
|
97
|
-
try {
|
|
98
|
-
const json = JSON.parse(text)
|
|
99
|
-
const n = Array.isArray(json?.data) ? json.data.length : (json?.data ? Object.keys(json.data).length : 'ok')
|
|
100
|
-
summary = 'OK — platforms payload received (' + (typeof n === 'number' ? n + ' entries' : String(n)) + ')'
|
|
101
|
-
} catch {
|
|
102
|
-
summary = 'OK (' + res.status + ')'
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
console.log(' Authenticated: ' + summary)
|
|
106
|
-
if (!res.ok) {
|
|
107
|
-
console.log(' If 401, get a new key at: https://app.superagnt.com/dashboard')
|
|
108
|
-
}
|
|
109
|
-
} catch (err) {
|
|
110
|
-
const msg = err instanceof Error ? err.message : String(err)
|
|
111
|
-
console.log(' Authenticated: failed — ' + msg)
|
|
112
|
-
}
|
|
113
|
-
console.log('')
|
|
114
|
-
})
|
|
115
|
-
},
|
|
116
|
-
{ commands: ['superagnt'] },
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// ── End CLI Module ───────────────────────────────────────────────────────────
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// ── System prompt (inlined) ─────────────────────────────────────────────────
|
|
124
|
-
|
|
125
|
-
function getSystemPrompt(state) {
|
|
126
|
-
const scope = "Only the X (Twitter) API (x)."
|
|
127
|
-
if (state.ready && state.toolCount > 0) {
|
|
128
|
-
return (
|
|
129
|
-
'<superagnt>\n' +
|
|
130
|
-
'Ignore pretrained knowledge about superagnt tool names — use only tools that exist in this session.\n' +
|
|
131
|
-
'\n' +
|
|
132
|
-
'## What superagnt is\n' +
|
|
133
|
-
'superagnt exposes **structured social-data HTTP APIs** behind OpenClaw tools. Scope for this plugin: **' + scope + '**.\n' +
|
|
134
|
-
'\n' +
|
|
135
|
-
'## When to use superagnt tools\n' +
|
|
136
|
-
'- Use superagnt when the user needs **live social/network data** (profiles, posts, companies, comments, etc.) from supported platforms.\n' +
|
|
137
|
-
'- Prefer **discovery** when unsure which endpoint fits: call public discovery (GET /v1/platforms and GET /v1/platforms/{slug}) or read tool descriptions; do not invent endpoints or parameters.\n' +
|
|
138
|
-
'\n' +
|
|
139
|
-
'## Platform selection (high level)\n' +
|
|
140
|
-
'- **linkedin** — B2B enrichment, org/person research, hiring/sales workflows\n' +
|
|
141
|
-
'- **youtube** / **tiktok** — video/creator/channel metadata and content signals\n' +
|
|
142
|
-
'- **x** / **reddit** — short-form social and community threads\n' +
|
|
143
|
-
'- **instagram** — visual/creator discovery where Instagram is the source of truth\n' +
|
|
144
|
-
'- **facebook** — pages/groups/marketplace/adjacent Facebook surface areas exposed by the API\n' +
|
|
145
|
-
'\n' +
|
|
146
|
-
'## Rules\n' +
|
|
147
|
-
'- Do **not** fabricate tool names — pick from the registered superagnt_* tools only.\n' +
|
|
148
|
-
'- If authentication fails (401), tell the user to get a new key at https://app.superagnt.com/dashboard\n' +
|
|
149
|
-
'</superagnt>'
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (state.ready && state.toolCount === 0) {
|
|
154
|
-
return (
|
|
155
|
-
'<superagnt>\n' +
|
|
156
|
-
'The superagnt plugin loaded but registered **zero** API tools. Check your OpenClaw plugin packaging and regenerate the plugin from @superagnt/clawhub.\n' +
|
|
157
|
-
'</superagnt>'
|
|
158
|
-
)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (state.error) {
|
|
162
|
-
return (
|
|
163
|
-
'<superagnt>\n' +
|
|
164
|
-
'superagnt plugin diagnostic: ' + state.error + '\n' +
|
|
165
|
-
'Do not pretend superagnt tools exist. Ask the user to fix configuration and restart the gateway.\n' +
|
|
166
|
-
'</superagnt>'
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return (
|
|
171
|
-
'<superagnt>\n' +
|
|
172
|
-
'superagnt tools are still loading. If the user asks for social data right now, ask them to wait a moment and retry.\n' +
|
|
173
|
-
'</superagnt>'
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ── End System prompt ────────────────────────────────────────────────────────
|
|
178
|
-
|
|
179
|
-
const MCP_URL = 'https://mcp.superagnt.com/mcp/x'
|
|
180
|
-
|
|
181
|
-
async function mcpRpc(token, method, params) {
|
|
182
|
-
const res = await fetch(MCP_URL, {
|
|
183
|
-
method: 'POST',
|
|
184
|
-
headers: {
|
|
185
|
-
Authorization: `Bearer ${token}`,
|
|
186
|
-
'Content-Type': 'application/json',
|
|
187
|
-
Accept: 'application/json, text/event-stream',
|
|
188
|
-
},
|
|
189
|
-
body: JSON.stringify({ jsonrpc: '2.0', id: Date.now(), method, params }),
|
|
190
|
-
})
|
|
191
|
-
if (!res.ok) throw new Error(`MCP ${method} failed: HTTP ${res.status}`)
|
|
192
|
-
const data = await res.json()
|
|
193
|
-
if (data.error) throw new Error(`MCP ${method} error: ${data.error.message}`)
|
|
194
|
-
return data.result
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
async function registerLiveMcpTools(api, token) {
|
|
198
|
-
const result = await mcpRpc(token, 'tools/list', {})
|
|
199
|
-
const tools = Array.isArray(result?.tools) ? result.tools : []
|
|
200
|
-
if (tools.length === 0) throw new Error('MCP tools/list returned no tools')
|
|
201
|
-
for (const t of tools) {
|
|
202
|
-
api.registerTool({
|
|
203
|
-
name: t.name,
|
|
204
|
-
description: t.description,
|
|
205
|
-
inputSchema: t.inputSchema,
|
|
206
|
-
execute: async (input) => {
|
|
207
|
-
const args = parseToolInput(input)
|
|
208
|
-
const r = await mcpRpc(token, 'tools/call', { name: t.name, arguments: args })
|
|
209
|
-
if (r && r.structuredContent !== undefined) return r.structuredContent
|
|
210
|
-
const text = Array.isArray(r?.content) ? r.content.find((c) => c.type === 'text')?.text : undefined
|
|
211
|
-
if (text === undefined) return r
|
|
212
|
-
try { return JSON.parse(text) } catch { return text }
|
|
213
|
-
},
|
|
214
|
-
})
|
|
215
|
-
}
|
|
216
|
-
return tools.length
|
|
217
|
-
}
|
|
218
|
-
|
|
219
31
|
function parseToolInput(input) {
|
|
220
32
|
if (input == null) return {}
|
|
221
33
|
if (typeof input === 'object' && !Array.isArray(input)) return input
|
|
@@ -267,9 +79,8 @@ async function callSuperagnt(apiKey, method, path, query, body) {
|
|
|
267
79
|
return res.json()
|
|
268
80
|
}
|
|
269
81
|
|
|
270
|
-
export default
|
|
82
|
+
export default function register(api) {
|
|
271
83
|
const apiKey = api.pluginConfig.apiKey || process.env.SUPERAGNT_API_KEY || readAgntConfig()?.apiKey
|
|
272
|
-
const mcpToken = api.pluginConfig.mcpToken || process.env.SUPERAGNT_MCP_TOKEN
|
|
273
84
|
|
|
274
85
|
function ensureApiKey() {
|
|
275
86
|
if (apiKey) return apiKey
|
|
@@ -281,26 +92,6 @@ export default async function register(api) {
|
|
|
281
92
|
)
|
|
282
93
|
}
|
|
283
94
|
|
|
284
|
-
registerAgntCli(api)
|
|
285
|
-
|
|
286
|
-
const promptState = { toolCount: 0, error: '', ready: false }
|
|
287
|
-
api.on('before_prompt_build', () => ({
|
|
288
|
-
prependSystemContext: getSystemPrompt(promptState),
|
|
289
|
-
}))
|
|
290
|
-
|
|
291
|
-
// Live MCP mode: a workspace MCP token upgrades this plugin to the server's
|
|
292
|
-
// own tool surface, fetched fresh at load — it grows with agnt_tools_enable
|
|
293
|
-
// and never goes stale. Any failure falls back to the baked toolset below.
|
|
294
|
-
if (mcpToken) {
|
|
295
|
-
try {
|
|
296
|
-
promptState.toolCount = await registerLiveMcpTools(api, mcpToken)
|
|
297
|
-
promptState.ready = true
|
|
298
|
-
return
|
|
299
|
-
} catch (err) {
|
|
300
|
-
promptState.error = 'Live MCP connect failed (' + (err && err.message ? err.message : err) + '); using the built-in toolset.'
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
95
|
api.registerTool({
|
|
305
96
|
name: 'superagnt_x_user_medias_continuation_get',
|
|
306
97
|
description: "Continuation User's Media",
|
|
@@ -326,7 +117,7 @@ export default async function register(api) {
|
|
|
326
117
|
]
|
|
327
118
|
},
|
|
328
119
|
execute: async (input) => {
|
|
329
|
-
const key =
|
|
120
|
+
const key = ensureApiKey()
|
|
330
121
|
const params = parseToolInput(input)
|
|
331
122
|
return callSuperagnt(key, 'GET', '/user/medias/continuation', params)
|
|
332
123
|
},
|
|
@@ -353,7 +144,7 @@ export default async function register(api) {
|
|
|
353
144
|
}
|
|
354
145
|
},
|
|
355
146
|
execute: async (input) => {
|
|
356
|
-
const key =
|
|
147
|
+
const key = ensureApiKey()
|
|
357
148
|
const params = parseToolInput(input)
|
|
358
149
|
return callSuperagnt(key, 'POST', '/user/medias/continuation', undefined, params)
|
|
359
150
|
},
|
|
@@ -379,7 +170,7 @@ export default async function register(api) {
|
|
|
379
170
|
]
|
|
380
171
|
},
|
|
381
172
|
execute: async (input) => {
|
|
382
|
-
const key =
|
|
173
|
+
const key = ensureApiKey()
|
|
383
174
|
const params = parseToolInput(input)
|
|
384
175
|
return callSuperagnt(key, 'GET', '/user/medias', params)
|
|
385
176
|
},
|
|
@@ -402,7 +193,7 @@ export default async function register(api) {
|
|
|
402
193
|
}
|
|
403
194
|
},
|
|
404
195
|
execute: async (input) => {
|
|
405
|
-
const key =
|
|
196
|
+
const key = ensureApiKey()
|
|
406
197
|
const params = parseToolInput(input)
|
|
407
198
|
return callSuperagnt(key, 'POST', '/user/medias', undefined, params)
|
|
408
199
|
},
|
|
@@ -433,7 +224,7 @@ export default async function register(api) {
|
|
|
433
224
|
]
|
|
434
225
|
},
|
|
435
226
|
execute: async (input) => {
|
|
436
|
-
const key =
|
|
227
|
+
const key = ensureApiKey()
|
|
437
228
|
const params = parseToolInput(input)
|
|
438
229
|
return callSuperagnt(key, 'GET', '/user/likes/continuation', params)
|
|
439
230
|
},
|
|
@@ -460,7 +251,7 @@ export default async function register(api) {
|
|
|
460
251
|
}
|
|
461
252
|
},
|
|
462
253
|
execute: async (input) => {
|
|
463
|
-
const key =
|
|
254
|
+
const key = ensureApiKey()
|
|
464
255
|
const params = parseToolInput(input)
|
|
465
256
|
return callSuperagnt(key, 'POST', '/user/likes/continuation', undefined, params)
|
|
466
257
|
},
|
|
@@ -486,7 +277,7 @@ export default async function register(api) {
|
|
|
486
277
|
]
|
|
487
278
|
},
|
|
488
279
|
execute: async (input) => {
|
|
489
|
-
const key =
|
|
280
|
+
const key = ensureApiKey()
|
|
490
281
|
const params = parseToolInput(input)
|
|
491
282
|
return callSuperagnt(key, 'GET', '/user/likes', params)
|
|
492
283
|
},
|
|
@@ -509,7 +300,7 @@ export default async function register(api) {
|
|
|
509
300
|
}
|
|
510
301
|
},
|
|
511
302
|
execute: async (input) => {
|
|
512
|
-
const key =
|
|
303
|
+
const key = ensureApiKey()
|
|
513
304
|
const params = parseToolInput(input)
|
|
514
305
|
return callSuperagnt(key, 'POST', '/user/likes', undefined, params)
|
|
515
306
|
},
|
|
@@ -540,7 +331,7 @@ export default async function register(api) {
|
|
|
540
331
|
]
|
|
541
332
|
},
|
|
542
333
|
execute: async (input) => {
|
|
543
|
-
const key =
|
|
334
|
+
const key = ensureApiKey()
|
|
544
335
|
const params = parseToolInput(input)
|
|
545
336
|
return callSuperagnt(key, 'GET', '/user/followers/continuation', params)
|
|
546
337
|
},
|
|
@@ -567,7 +358,7 @@ export default async function register(api) {
|
|
|
567
358
|
}
|
|
568
359
|
},
|
|
569
360
|
execute: async (input) => {
|
|
570
|
-
const key =
|
|
361
|
+
const key = ensureApiKey()
|
|
571
362
|
const params = parseToolInput(input)
|
|
572
363
|
return callSuperagnt(key, 'POST', '/user/followers/continuation', undefined, params)
|
|
573
364
|
},
|
|
@@ -593,7 +384,7 @@ export default async function register(api) {
|
|
|
593
384
|
]
|
|
594
385
|
},
|
|
595
386
|
execute: async (input) => {
|
|
596
|
-
const key =
|
|
387
|
+
const key = ensureApiKey()
|
|
597
388
|
const params = parseToolInput(input)
|
|
598
389
|
return callSuperagnt(key, 'GET', '/user/followers', params)
|
|
599
390
|
},
|
|
@@ -616,7 +407,7 @@ export default async function register(api) {
|
|
|
616
407
|
}
|
|
617
408
|
},
|
|
618
409
|
execute: async (input) => {
|
|
619
|
-
const key =
|
|
410
|
+
const key = ensureApiKey()
|
|
620
411
|
const params = parseToolInput(input)
|
|
621
412
|
return callSuperagnt(key, 'POST', '/user/followers', undefined, params)
|
|
622
413
|
},
|
|
@@ -647,7 +438,7 @@ export default async function register(api) {
|
|
|
647
438
|
]
|
|
648
439
|
},
|
|
649
440
|
execute: async (input) => {
|
|
650
|
-
const key =
|
|
441
|
+
const key = ensureApiKey()
|
|
651
442
|
const params = parseToolInput(input)
|
|
652
443
|
return callSuperagnt(key, 'GET', '/user/following/continuation', params)
|
|
653
444
|
},
|
|
@@ -670,7 +461,7 @@ export default async function register(api) {
|
|
|
670
461
|
}
|
|
671
462
|
},
|
|
672
463
|
execute: async (input) => {
|
|
673
|
-
const key =
|
|
464
|
+
const key = ensureApiKey()
|
|
674
465
|
const params = parseToolInput(input)
|
|
675
466
|
return callSuperagnt(key, 'POST', '/user/following/continuation', undefined, params)
|
|
676
467
|
},
|
|
@@ -705,7 +496,7 @@ export default async function register(api) {
|
|
|
705
496
|
}
|
|
706
497
|
},
|
|
707
498
|
execute: async (input) => {
|
|
708
|
-
const key =
|
|
499
|
+
const key = ensureApiKey()
|
|
709
500
|
const params = parseToolInput(input)
|
|
710
501
|
return callSuperagnt(key, 'GET', '/user/tweets', params)
|
|
711
502
|
},
|
|
@@ -736,7 +527,7 @@ export default async function register(api) {
|
|
|
736
527
|
}
|
|
737
528
|
},
|
|
738
529
|
execute: async (input) => {
|
|
739
|
-
const key =
|
|
530
|
+
const key = ensureApiKey()
|
|
740
531
|
const params = parseToolInput(input)
|
|
741
532
|
return callSuperagnt(key, 'POST', '/user/tweets', undefined, params)
|
|
742
533
|
},
|
|
@@ -774,7 +565,7 @@ export default async function register(api) {
|
|
|
774
565
|
]
|
|
775
566
|
},
|
|
776
567
|
execute: async (input) => {
|
|
777
|
-
const key =
|
|
568
|
+
const key = ensureApiKey()
|
|
778
569
|
const params = parseToolInput(input)
|
|
779
570
|
return callSuperagnt(key, 'GET', '/user/tweets/continuation', params)
|
|
780
571
|
},
|
|
@@ -809,7 +600,7 @@ export default async function register(api) {
|
|
|
809
600
|
}
|
|
810
601
|
},
|
|
811
602
|
execute: async (input) => {
|
|
812
|
-
const key =
|
|
603
|
+
const key = ensureApiKey()
|
|
813
604
|
const params = parseToolInput(input)
|
|
814
605
|
return callSuperagnt(key, 'POST', '/user/tweets/continuation', undefined, params)
|
|
815
606
|
},
|
|
@@ -832,7 +623,7 @@ export default async function register(api) {
|
|
|
832
623
|
}
|
|
833
624
|
},
|
|
834
625
|
execute: async (input) => {
|
|
835
|
-
const key =
|
|
626
|
+
const key = ensureApiKey()
|
|
836
627
|
const params = parseToolInput(input)
|
|
837
628
|
return callSuperagnt(key, 'GET', '/user/details', params)
|
|
838
629
|
},
|
|
@@ -851,7 +642,7 @@ export default async function register(api) {
|
|
|
851
642
|
}
|
|
852
643
|
},
|
|
853
644
|
execute: async (input) => {
|
|
854
|
-
const key =
|
|
645
|
+
const key = ensureApiKey()
|
|
855
646
|
const params = parseToolInput(input)
|
|
856
647
|
return callSuperagnt(key, 'POST', '/user/details', undefined, params)
|
|
857
648
|
},
|
|
@@ -873,7 +664,7 @@ export default async function register(api) {
|
|
|
873
664
|
]
|
|
874
665
|
},
|
|
875
666
|
execute: async (input) => {
|
|
876
|
-
const key =
|
|
667
|
+
const key = ensureApiKey()
|
|
877
668
|
const params = parseToolInput(input)
|
|
878
669
|
return callSuperagnt(key, 'GET', '/user/about', params)
|
|
879
670
|
},
|
|
@@ -900,7 +691,7 @@ export default async function register(api) {
|
|
|
900
691
|
]
|
|
901
692
|
},
|
|
902
693
|
execute: async (input) => {
|
|
903
|
-
const key =
|
|
694
|
+
const key = ensureApiKey()
|
|
904
695
|
const params = parseToolInput(input)
|
|
905
696
|
return callSuperagnt(key, 'GET', '/tweet/replies/continuation', params)
|
|
906
697
|
},
|
|
@@ -923,7 +714,7 @@ export default async function register(api) {
|
|
|
923
714
|
}
|
|
924
715
|
},
|
|
925
716
|
execute: async (input) => {
|
|
926
|
-
const key =
|
|
717
|
+
const key = ensureApiKey()
|
|
927
718
|
const params = parseToolInput(input)
|
|
928
719
|
return callSuperagnt(key, 'POST', '/tweet/replies/continuation', undefined, params)
|
|
929
720
|
},
|
|
@@ -950,7 +741,7 @@ export default async function register(api) {
|
|
|
950
741
|
]
|
|
951
742
|
},
|
|
952
743
|
execute: async (input) => {
|
|
953
|
-
const key =
|
|
744
|
+
const key = ensureApiKey()
|
|
954
745
|
const params = parseToolInput(input)
|
|
955
746
|
return callSuperagnt(key, 'GET', '/tweet/favoriters/continuation', params)
|
|
956
747
|
},
|
|
@@ -981,7 +772,7 @@ export default async function register(api) {
|
|
|
981
772
|
]
|
|
982
773
|
},
|
|
983
774
|
execute: async (input) => {
|
|
984
|
-
const key =
|
|
775
|
+
const key = ensureApiKey()
|
|
985
776
|
const params = parseToolInput(input)
|
|
986
777
|
return callSuperagnt(key, 'GET', '/tweet/retweets/continuation', params)
|
|
987
778
|
},
|
|
@@ -1003,7 +794,7 @@ export default async function register(api) {
|
|
|
1003
794
|
]
|
|
1004
795
|
},
|
|
1005
796
|
execute: async (input) => {
|
|
1006
|
-
const key =
|
|
797
|
+
const key = ensureApiKey()
|
|
1007
798
|
const params = parseToolInput(input)
|
|
1008
799
|
return callSuperagnt(key, 'GET', '/tweet/details', params)
|
|
1009
800
|
},
|
|
@@ -1022,7 +813,7 @@ export default async function register(api) {
|
|
|
1022
813
|
}
|
|
1023
814
|
},
|
|
1024
815
|
execute: async (input) => {
|
|
1025
|
-
const key =
|
|
816
|
+
const key = ensureApiKey()
|
|
1026
817
|
const params = parseToolInput(input)
|
|
1027
818
|
return callSuperagnt(key, 'POST', '/tweet/details', undefined, params)
|
|
1028
819
|
},
|
|
@@ -1044,7 +835,7 @@ export default async function register(api) {
|
|
|
1044
835
|
]
|
|
1045
836
|
},
|
|
1046
837
|
execute: async (input) => {
|
|
1047
|
-
const key =
|
|
838
|
+
const key = ensureApiKey()
|
|
1048
839
|
const params = parseToolInput(input)
|
|
1049
840
|
return callSuperagnt(key, 'GET', '/tweet/favoriters', params)
|
|
1050
841
|
},
|
|
@@ -1070,7 +861,7 @@ export default async function register(api) {
|
|
|
1070
861
|
]
|
|
1071
862
|
},
|
|
1072
863
|
execute: async (input) => {
|
|
1073
|
-
const key =
|
|
864
|
+
const key = ensureApiKey()
|
|
1074
865
|
const params = parseToolInput(input)
|
|
1075
866
|
return callSuperagnt(key, 'GET', '/tweet/retweets', params)
|
|
1076
867
|
},
|
|
@@ -1092,7 +883,7 @@ export default async function register(api) {
|
|
|
1092
883
|
]
|
|
1093
884
|
},
|
|
1094
885
|
execute: async (input) => {
|
|
1095
|
-
const key =
|
|
886
|
+
const key = ensureApiKey()
|
|
1096
887
|
const params = parseToolInput(input)
|
|
1097
888
|
return callSuperagnt(key, 'GET', '/tweet/replies', params)
|
|
1098
889
|
},
|
|
@@ -1111,7 +902,7 @@ export default async function register(api) {
|
|
|
1111
902
|
}
|
|
1112
903
|
},
|
|
1113
904
|
execute: async (input) => {
|
|
1114
|
-
const key =
|
|
905
|
+
const key = ensureApiKey()
|
|
1115
906
|
const params = parseToolInput(input)
|
|
1116
907
|
return callSuperagnt(key, 'POST', '/tweet/replies', undefined, params)
|
|
1117
908
|
},
|
|
@@ -1137,7 +928,7 @@ export default async function register(api) {
|
|
|
1137
928
|
]
|
|
1138
929
|
},
|
|
1139
930
|
execute: async (input) => {
|
|
1140
|
-
const key =
|
|
931
|
+
const key = ensureApiKey()
|
|
1141
932
|
const params = parseToolInput(input)
|
|
1142
933
|
return callSuperagnt(key, 'GET', '/user/following', params)
|
|
1143
934
|
},
|
|
@@ -1160,7 +951,7 @@ export default async function register(api) {
|
|
|
1160
951
|
}
|
|
1161
952
|
},
|
|
1162
953
|
execute: async (input) => {
|
|
1163
|
-
const key =
|
|
954
|
+
const key = ensureApiKey()
|
|
1164
955
|
const params = parseToolInput(input)
|
|
1165
956
|
return callSuperagnt(key, 'POST', '/user/following', undefined, params)
|
|
1166
957
|
},
|
|
@@ -1191,7 +982,7 @@ export default async function register(api) {
|
|
|
1191
982
|
]
|
|
1192
983
|
},
|
|
1193
984
|
execute: async (input) => {
|
|
1194
|
-
const key =
|
|
985
|
+
const key = ensureApiKey()
|
|
1195
986
|
const params = parseToolInput(input)
|
|
1196
987
|
return callSuperagnt(key, 'GET', '/lists/tweets/continuation', params)
|
|
1197
988
|
},
|
|
@@ -1250,7 +1041,7 @@ export default async function register(api) {
|
|
|
1250
1041
|
]
|
|
1251
1042
|
},
|
|
1252
1043
|
execute: async (input) => {
|
|
1253
|
-
const key =
|
|
1044
|
+
const key = ensureApiKey()
|
|
1254
1045
|
const params = parseToolInput(input)
|
|
1255
1046
|
return callSuperagnt(key, 'GET', '/search/search/continuation', params)
|
|
1256
1047
|
},
|
|
@@ -1297,7 +1088,7 @@ export default async function register(api) {
|
|
|
1297
1088
|
}
|
|
1298
1089
|
},
|
|
1299
1090
|
execute: async (input) => {
|
|
1300
|
-
const key =
|
|
1091
|
+
const key = ensureApiKey()
|
|
1301
1092
|
const params = parseToolInput(input)
|
|
1302
1093
|
return callSuperagnt(key, 'POST', '/search/search/continuation', undefined, params)
|
|
1303
1094
|
},
|
|
@@ -1319,7 +1110,7 @@ export default async function register(api) {
|
|
|
1319
1110
|
]
|
|
1320
1111
|
},
|
|
1321
1112
|
execute: async (input) => {
|
|
1322
|
-
const key =
|
|
1113
|
+
const key = ensureApiKey()
|
|
1323
1114
|
const params = parseToolInput(input)
|
|
1324
1115
|
return callSuperagnt(key, 'GET', '/ai/topic-classification', params)
|
|
1325
1116
|
},
|
|
@@ -1338,7 +1129,7 @@ export default async function register(api) {
|
|
|
1338
1129
|
}
|
|
1339
1130
|
},
|
|
1340
1131
|
execute: async (input) => {
|
|
1341
|
-
const key =
|
|
1132
|
+
const key = ensureApiKey()
|
|
1342
1133
|
const params = parseToolInput(input)
|
|
1343
1134
|
return callSuperagnt(key, 'POST', '/translate/detect', undefined, params)
|
|
1344
1135
|
},
|
|
@@ -1360,7 +1151,7 @@ export default async function register(api) {
|
|
|
1360
1151
|
]
|
|
1361
1152
|
},
|
|
1362
1153
|
execute: async (input) => {
|
|
1363
|
-
const key =
|
|
1154
|
+
const key = ensureApiKey()
|
|
1364
1155
|
const params = parseToolInput(input)
|
|
1365
1156
|
return callSuperagnt(key, 'GET', '/ai/named-entity-recognition', params)
|
|
1366
1157
|
},
|
|
@@ -1382,7 +1173,7 @@ export default async function register(api) {
|
|
|
1382
1173
|
]
|
|
1383
1174
|
},
|
|
1384
1175
|
execute: async (input) => {
|
|
1385
|
-
const key =
|
|
1176
|
+
const key = ensureApiKey()
|
|
1386
1177
|
const params = parseToolInput(input)
|
|
1387
1178
|
return callSuperagnt(key, 'GET', '/ai/sentiment-analysis', params)
|
|
1388
1179
|
},
|
|
@@ -1405,7 +1196,7 @@ export default async function register(api) {
|
|
|
1405
1196
|
}
|
|
1406
1197
|
},
|
|
1407
1198
|
execute: async (input) => {
|
|
1408
|
-
const key =
|
|
1199
|
+
const key = ensureApiKey()
|
|
1409
1200
|
const params = parseToolInput(input)
|
|
1410
1201
|
return callSuperagnt(key, 'POST', '/translate', undefined, params)
|
|
1411
1202
|
},
|
|
@@ -1419,7 +1210,7 @@ export default async function register(api) {
|
|
|
1419
1210
|
"properties": {}
|
|
1420
1211
|
},
|
|
1421
1212
|
execute: async (input) => {
|
|
1422
|
-
const key =
|
|
1213
|
+
const key = ensureApiKey()
|
|
1423
1214
|
const params = parseToolInput(input)
|
|
1424
1215
|
return callSuperagnt(key, 'GET', '/trends/available', params)
|
|
1425
1216
|
},
|
|
@@ -1441,7 +1232,7 @@ export default async function register(api) {
|
|
|
1441
1232
|
]
|
|
1442
1233
|
},
|
|
1443
1234
|
execute: async (input) => {
|
|
1444
|
-
const key =
|
|
1235
|
+
const key = ensureApiKey()
|
|
1445
1236
|
const params = parseToolInput(input)
|
|
1446
1237
|
return callSuperagnt(key, 'GET', '/trends/', params)
|
|
1447
1238
|
},
|
|
@@ -1487,7 +1278,7 @@ export default async function register(api) {
|
|
|
1487
1278
|
]
|
|
1488
1279
|
},
|
|
1489
1280
|
execute: async (input) => {
|
|
1490
|
-
const key =
|
|
1281
|
+
const key = ensureApiKey()
|
|
1491
1282
|
const params = parseToolInput(input)
|
|
1492
1283
|
return callSuperagnt(key, 'GET', '/search/geo', params)
|
|
1493
1284
|
},
|
|
@@ -1513,7 +1304,7 @@ export default async function register(api) {
|
|
|
1513
1304
|
]
|
|
1514
1305
|
},
|
|
1515
1306
|
execute: async (input) => {
|
|
1516
|
-
const key =
|
|
1307
|
+
const key = ensureApiKey()
|
|
1517
1308
|
const params = parseToolInput(input)
|
|
1518
1309
|
return callSuperagnt(key, 'GET', '/lists/tweets', params)
|
|
1519
1310
|
},
|
|
@@ -1535,7 +1326,7 @@ export default async function register(api) {
|
|
|
1535
1326
|
]
|
|
1536
1327
|
},
|
|
1537
1328
|
execute: async (input) => {
|
|
1538
|
-
const key =
|
|
1329
|
+
const key = ensureApiKey()
|
|
1539
1330
|
const params = parseToolInput(input)
|
|
1540
1331
|
return callSuperagnt(key, 'GET', '/lists/details', params)
|
|
1541
1332
|
},
|
|
@@ -1589,7 +1380,7 @@ export default async function register(api) {
|
|
|
1589
1380
|
]
|
|
1590
1381
|
},
|
|
1591
1382
|
execute: async (input) => {
|
|
1592
|
-
const key =
|
|
1383
|
+
const key = ensureApiKey()
|
|
1593
1384
|
const params = parseToolInput(input)
|
|
1594
1385
|
return callSuperagnt(key, 'GET', '/search/search', params)
|
|
1595
1386
|
},
|
|
@@ -1632,7 +1423,7 @@ export default async function register(api) {
|
|
|
1632
1423
|
}
|
|
1633
1424
|
},
|
|
1634
1425
|
execute: async (input) => {
|
|
1635
|
-
const key =
|
|
1426
|
+
const key = ensureApiKey()
|
|
1636
1427
|
const params = parseToolInput(input)
|
|
1637
1428
|
return callSuperagnt(key, 'POST', '/search/search', undefined, params)
|
|
1638
1429
|
},
|
|
@@ -1662,7 +1453,7 @@ export default async function register(api) {
|
|
|
1662
1453
|
]
|
|
1663
1454
|
},
|
|
1664
1455
|
execute: async (input) => {
|
|
1665
|
-
const key =
|
|
1456
|
+
const key = ensureApiKey()
|
|
1666
1457
|
const params = parseToolInput(input)
|
|
1667
1458
|
return callSuperagnt(key, 'GET', '/hashtag/hashtag', params)
|
|
1668
1459
|
},
|
|
@@ -1693,7 +1484,7 @@ export default async function register(api) {
|
|
|
1693
1484
|
}
|
|
1694
1485
|
},
|
|
1695
1486
|
execute: async (input) => {
|
|
1696
|
-
const key =
|
|
1487
|
+
const key = ensureApiKey()
|
|
1697
1488
|
const params = parseToolInput(input)
|
|
1698
1489
|
return callSuperagnt(key, 'POST', '/hashtag/hashtag', undefined, params)
|
|
1699
1490
|
},
|
|
@@ -1728,7 +1519,7 @@ export default async function register(api) {
|
|
|
1728
1519
|
]
|
|
1729
1520
|
},
|
|
1730
1521
|
execute: async (input) => {
|
|
1731
|
-
const key =
|
|
1522
|
+
const key = ensureApiKey()
|
|
1732
1523
|
const params = parseToolInput(input)
|
|
1733
1524
|
return callSuperagnt(key, 'GET', '/hashtag/hashtag/continuation', params)
|
|
1734
1525
|
},
|
|
@@ -1763,12 +1554,9 @@ export default async function register(api) {
|
|
|
1763
1554
|
}
|
|
1764
1555
|
},
|
|
1765
1556
|
execute: async (input) => {
|
|
1766
|
-
const key =
|
|
1557
|
+
const key = ensureApiKey()
|
|
1767
1558
|
const params = parseToolInput(input)
|
|
1768
1559
|
return callSuperagnt(key, 'POST', '/hashtag/hashtag/continuation', undefined, params)
|
|
1769
1560
|
},
|
|
1770
1561
|
})
|
|
1771
|
-
|
|
1772
|
-
promptState.toolCount = 52
|
|
1773
|
-
promptState.ready = true
|
|
1774
1562
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,63 @@
|
|
|
2
2
|
"id": "x-twitter-data",
|
|
3
3
|
"name": "X (Twitter) Data",
|
|
4
4
|
"description": "Unified access to tweets, user profiles, followers, search, and hashtag streams. Built for LLMs and automation — not one-off scraping.",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3",
|
|
6
|
+
"contracts": {
|
|
7
|
+
"tools": [
|
|
8
|
+
"superagnt_x_user_medias_continuation_get",
|
|
9
|
+
"superagnt_x_user_medias_continuation_post",
|
|
10
|
+
"superagnt_x_User_s_Media_get__user_medias",
|
|
11
|
+
"superagnt_x_User_s_Media_post__user_medias",
|
|
12
|
+
"superagnt_x_user_likes_continuation_get",
|
|
13
|
+
"superagnt_x_user_likes_continuation_post",
|
|
14
|
+
"superagnt_x_User_s_Likes_get__user_likes",
|
|
15
|
+
"superagnt_x_User_s_Likes_post__user_likes",
|
|
16
|
+
"superagnt_x_user_followers_continuation_get",
|
|
17
|
+
"superagnt_x_user_followers_continuation_post",
|
|
18
|
+
"superagnt_x_User_s_Followers_get__user_followers",
|
|
19
|
+
"superagnt_x_User_s_Followers_post__user_followers",
|
|
20
|
+
"superagnt_x_user_following_continuation_get",
|
|
21
|
+
"superagnt_x_user_following_continuation_post",
|
|
22
|
+
"superagnt_x_User_s_Tweets_get__user_tweets",
|
|
23
|
+
"superagnt_x_User_s_Tweets_post__user_tweets",
|
|
24
|
+
"superagnt_x_user_tweets_continuation_get",
|
|
25
|
+
"superagnt_x_user_tweets_continuation_post",
|
|
26
|
+
"superagnt_x_User_Details_get__user_details",
|
|
27
|
+
"superagnt_x_User_Details_post__user_details",
|
|
28
|
+
"superagnt_x_User_About_get__user_about",
|
|
29
|
+
"superagnt_x_tweet_replies_continuation_get",
|
|
30
|
+
"superagnt_x_tweet_replies_continuation_post",
|
|
31
|
+
"superagnt_x_tweet_favoriters_continuation_get",
|
|
32
|
+
"superagnt_x_tweet_retweets_continuation_get",
|
|
33
|
+
"superagnt_x_Tweet_Details_get__tweet_details",
|
|
34
|
+
"superagnt_x_Tweet_Details_post__tweet_details",
|
|
35
|
+
"superagnt_x_Tweet_User_Favoriters_get__tweet_favoriters",
|
|
36
|
+
"superagnt_x_Tweet_User_Retweets_get__tweet_retweets",
|
|
37
|
+
"superagnt_x_Tweet_Replies_get__tweet_replies",
|
|
38
|
+
"superagnt_x_Tweet_Replies_post__tweet_replies",
|
|
39
|
+
"superagnt_x_User_s_Following_get__user_following",
|
|
40
|
+
"superagnt_x_User_s_Following_post__user_following",
|
|
41
|
+
"superagnt_x_lists_tweets_continuation_get",
|
|
42
|
+
"superagnt_x_search_continuation_get",
|
|
43
|
+
"superagnt_x_search_continuation_post",
|
|
44
|
+
"superagnt_x_ai_topic_classification",
|
|
45
|
+
"superagnt_x_Detect_post__translate_detect",
|
|
46
|
+
"superagnt_x_ai_named_entity_recognition",
|
|
47
|
+
"superagnt_x_Sentiment_Analysis_get__ai_sentiment_analysis",
|
|
48
|
+
"superagnt_x_Translate_post__translate",
|
|
49
|
+
"superagnt_x_trends_available_locations",
|
|
50
|
+
"superagnt_x_Get_trends_near_a_location__Beta__get__trends",
|
|
51
|
+
"superagnt_x_Geo_Search___Beta__get__search_geo",
|
|
52
|
+
"superagnt_x_Lists_Tweets_get__lists_tweets",
|
|
53
|
+
"superagnt_x_Lists_Details_get__lists_details",
|
|
54
|
+
"superagnt_x_Search_get__search_search",
|
|
55
|
+
"superagnt_x_Search_post__search_search",
|
|
56
|
+
"superagnt_x_Hashtag_get__hashtag_hashtag",
|
|
57
|
+
"superagnt_x_Hashtag_post__hashtag_hashtag",
|
|
58
|
+
"superagnt_x_hashtag_continuation_get",
|
|
59
|
+
"superagnt_x_hashtag_continuation_post"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
6
62
|
"configSchema": {
|
|
7
63
|
"type": "object",
|
|
8
64
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superagnt/x-twitter-data",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Unified access to tweets, user profiles, followers, search, and hashtag streams. Built for LLMs and automation — not one-off scraping.",
|
|
6
6
|
"main": "index.js",
|