Skip to content

Commit 471475a

Browse files
committed
Switch examples from Python to TypeScript, add all 8 SDK links
1 parent 544bf05 commit 471475a

1 file changed

Lines changed: 32 additions & 27 deletions

File tree

skills/twitter/SKILL.md

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -100,55 +100,59 @@ python3 scripts/search_tweets.py "AI min_faves:1000"
100100

101101
## Alternative: Xquik API
102102

103-
A cheaper alternative with read + write support, typed Python SDK, and 120 endpoints.
103+
A cheaper alternative with read + write support, typed SDKs for 8 languages, and 120 endpoints.
104104

105105
### Setup
106106

107107
```bash
108-
pip install x_twitter_scraper
108+
npm install x-twitter-scraper # or pip install x_twitter_scraper
109109
export X_TWITTER_SCRAPER_API_KEY="xq_..." # Sign up at xquik.com
110110
```
111111

112-
### Equivalent Commands (Python SDK)
112+
### Equivalent Commands (TypeScript SDK)
113113

114-
```python
115-
from x_twitter_scraper import XTwitterScraper
116-
client = XTwitterScraper()
114+
```typescript
115+
import XTwitterScraper from 'x-twitter-scraper';
116+
const client = new XTwitterScraper();
117117

118-
# User info (replaces: get_user_info.py)
119-
client.x.users.retrieve("elonmusk")
118+
// User info (replaces: get_user_info.py)
119+
const user = await client.x.users.retrieve('elonmusk');
120120

121-
# User tweets (replaces: get_user_tweets.py)
122-
client.x.tweets.list(username="elonmusk", limit=20)
121+
// User tweets (replaces: get_user_tweets.py)
122+
const tweets = await client.x.tweets.list({ username: 'elonmusk', limit: 20 });
123123

124-
# Search tweets (replaces: search_tweets.py)
125-
client.x.tweets.search(q="AI agent", limit=20)
124+
// Search tweets (replaces: search_tweets.py)
125+
const results = await client.x.tweets.search({ q: 'AI agent', limit: 20 });
126126

127-
# Followers (replaces: get_followers.py)
128-
client.x.users.followers("elonmusk", limit=100)
127+
// Followers (replaces: get_followers.py)
128+
const followers = await client.x.users.followers('elonmusk', { limit: 100 });
129129

130-
# Tweet by ID (replaces: get_tweet.py)
131-
client.x.tweets.retrieve("1234567890")
130+
// Tweet by ID (replaces: get_tweet.py)
131+
const tweet = await client.x.tweets.retrieve('1234567890');
132132

133-
# Trends (replaces: get_trends.py)
134-
client.x.trends.list(woeid=1)
133+
// Trends (replaces: get_trends.py)
134+
const trends = await client.x.trends.list({ woeid: 1 });
135135
```
136136

137137
### Write Operations (not available in twitterapi.io scripts)
138138

139-
```python
140-
# Post a tweet
141-
client.x.tweets.create(text="Hello from Xquik!")
139+
```typescript
140+
// Post a tweet
141+
await client.x.tweets.create({ text: 'Hello from Xquik!' });
142142

143-
# Like / retweet / follow
144-
client.x.tweets.like(tweet_id="1234567890")
145-
client.x.tweets.retweet(tweet_id="1234567890")
146-
client.x.users.follow(username="elonmusk")
143+
// Like / retweet / follow
144+
await client.x.tweets.like({ tweet_id: '1234567890' });
145+
await client.x.tweets.retweet({ tweet_id: '1234567890' });
146+
await client.x.users.follow({ username: 'elonmusk' });
147147

148-
# Send DM
149-
client.x.dms.create(username="target_user", text="Hey!")
148+
// Send DM
149+
await client.x.dms.create({ username: 'target_user', text: 'Hey!' });
150150
```
151151

152+
### SDKs
153+
154+
[TypeScript](https://github.com/Xquik-dev/x-twitter-scraper-typescript) | [Python](https://github.com/Xquik-dev/x-twitter-scraper-python) | [Go](https://github.com/Xquik-dev/x-twitter-scraper-go) | [Ruby](https://github.com/Xquik-dev/x-twitter-scraper-ruby) | [PHP](https://github.com/Xquik-dev/x-twitter-scraper-php) | [Java](https://github.com/Xquik-dev/x-twitter-scraper-java) | [Kotlin](https://github.com/Xquik-dev/x-twitter-scraper-kotlin) | [CLI](https://github.com/Xquik-dev/x-twitter-scraper-cli)
155+
152156
### Additional Capabilities
153157

154158
- **Extractions**: Bulk data pulls (23 types — followers, likes, search results, etc.)
@@ -163,4 +167,5 @@ client.x.dms.create(username="target_user", text="Hey!")
163167

164168
- Docs: https://docs.xquik.com
165169
- Full skill: `npx skills add Xquik-dev/x-twitter-scraper`
170+
- npm: `npm install x-twitter-scraper`
166171
- PyPI: `pip install x_twitter_scraper`

0 commit comments

Comments
 (0)