Skip to content

Commit b583617

Browse files
committed
Add X Twitter scraper skill
1 parent d944a73 commit b583617

2 files changed

Lines changed: 97 additions & 0 deletions

File tree

docs/README.skills.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,4 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to
363363
| [winui3-migration-guide](../skills/winui3-migration-guide/SKILL.md)<br />`gh skills install github/awesome-copilot winui3-migration-guide` | UWP-to-WinUI 3 migration reference. Maps legacy UWP APIs to correct Windows App SDK equivalents with before/after code snippets. Covers namespace changes, threading (CoreDispatcher to DispatcherQueue), windowing (CoreWindow to AppWindow), dialogs, pickers, sharing, printing, background tasks, and the most common Copilot code generation mistakes. | None |
364364
| [workiq-copilot](../skills/workiq-copilot/SKILL.md)<br />`gh skills install github/awesome-copilot workiq-copilot` | Guides the Copilot CLI on how to use the WorkIQ CLI/MCP server to query Microsoft 365 Copilot data (emails, meetings, docs, Teams, people) for live context, summaries, and recommendations. | None |
365365
| [write-coding-standards-from-file](../skills/write-coding-standards-from-file/SKILL.md)<br />`gh skills install github/awesome-copilot write-coding-standards-from-file` | Write a coding standards document for a project using the coding styles from the file(s) and/or folder(s) passed as arguments in the prompt. | None |
366+
| [x-twitter-scraper](../skills/x-twitter-scraper/SKILL.md)<br />`gh skills install github/awesome-copilot x-twitter-scraper` | Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, MCP tools, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation. | None |

skills/x-twitter-scraper/SKILL.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: x-twitter-scraper
3+
description: 'Build GitHub Copilot workflows with Xquik X API SDKs, REST endpoints, MCP tools, signed webhooks, tweet search, user lookup, follower exports, media actions, and agent automation.'
4+
---
5+
6+
# X Twitter Scraper
7+
8+
Use this skill when a user wants to integrate Xquik into an app, script, data pipeline, or AI agent workflow for X API and Twitter scraper tasks.
9+
10+
## Use Cases
11+
12+
- Search tweets, fetch tweet details, read timelines, and download media.
13+
- Look up users, check relationships, and export followers or following.
14+
- Start extraction jobs for replies, reposts, quotes, likes, lists, communities, articles, and search results.
15+
- Create account monitors and verify HMAC-signed webhook events.
16+
- Add TypeScript, Python, Go, Java, Kotlin, C#, Ruby, PHP, CLI, or Terraform clients.
17+
- Connect agent runtimes through the Xquik MCP server.
18+
19+
## Source Checks
20+
21+
Before writing code, inspect the current Xquik source material:
22+
23+
- REST API docs: https://docs.xquik.com/api-reference/overview
24+
- SDK index: https://docs.xquik.com/sdks
25+
- OpenAPI spec: https://xquik.com/openapi.json
26+
- MCP server docs: https://docs.xquik.com/mcp
27+
- TypeScript SDK: https://github.com/Xquik-dev/x-twitter-scraper-typescript
28+
- Skill repo: https://github.com/Xquik-dev/x-twitter-scraper
29+
30+
Do not invent endpoint names, request fields, response fields, scopes, pricing, limits, or package names. Read the relevant SDK README and API reference page first.
31+
32+
## Implementation Flow
33+
34+
1. Identify the workflow: search, lookup, extraction, monitor, webhook, media, write action, billing, or MCP.
35+
2. Choose the integration surface: generated SDK for application code, REST for custom clients, MCP for agents, or webhooks for event delivery.
36+
3. Confirm authentication requirements from the docs and use environment variables for API keys.
37+
4. Use typed request and response models when an SDK exists for the user's language.
38+
5. Add retries and pagination according to the SDK or API docs.
39+
6. Add explicit user confirmation before write actions, payment flows, or long-running monitoring.
40+
7. Keep webhook verification server-side and compare HMAC signatures before processing events.
41+
8. Return structured data to the caller instead of scraping generated UI output.
42+
43+
## TypeScript SDK Pattern
44+
45+
Install the TypeScript SDK only after checking the current package README:
46+
47+
```bash
48+
npm install x-twitter-scraper
49+
```
50+
51+
Use server-side code for API calls:
52+
53+
```ts
54+
import XTwitterScraper from "x-twitter-scraper";
55+
56+
type SearchTweetsInput = {
57+
query: string;
58+
limit?: number;
59+
};
60+
61+
export async function searchTweets(input: SearchTweetsInput) {
62+
const client = new XTwitterScraper({
63+
apiKey: process.env.X_TWITTER_SCRAPER_API_KEY,
64+
});
65+
66+
return client.x.tweets.search({
67+
q: input.query,
68+
limit: input.limit ?? 10,
69+
});
70+
}
71+
```
72+
73+
## Webhook Pattern
74+
75+
When adding webhook handlers:
76+
77+
- Read the documented signing header name and payload format.
78+
- Verify the HMAC signature before parsing business logic.
79+
- Reject missing, malformed, or mismatched signatures.
80+
- Make handlers idempotent because webhook delivery can retry.
81+
- Store only the fields needed for the product workflow.
82+
83+
## MCP Pattern
84+
85+
Use the MCP server when the user wants an agent to explore or call Xquik tools directly. Keep application code on REST or SDK clients when the app needs stable typed contracts, tests, or internal abstractions.
86+
87+
## Safety And Accuracy
88+
89+
- Keep language neutral and technical.
90+
- State that Xquik is a third-party X data and automation API.
91+
- Do not claim affiliation with X Corp.
92+
- Do not bypass access controls or platform policies.
93+
- Do not expose API keys, webhook secrets, account cookies, tokens, or raw signatures.
94+
- Do not hard-code credentials in examples or tests.
95+
- Do not document private infrastructure details.
96+
- Prefer official Xquik docs, SDK READMEs, and the OpenAPI spec over memory.

0 commit comments

Comments
 (0)