# &

XiaoHongShu、Douyin、Twitter/X、Weibo、Bilibili、V2EX、Reddit。

## XiaoHongShu / XiaoHongShu (xhs-cli)

### Available

```bash
# search
xhs search "query"

# search URL ID note_id
xhs read NOTE_ID_OR_URL

# comments
xhs comments NOTE_ID_OR_URL

xhs hot

# feed
xhs feed
```

### v0.6.4

```bash
# API error
xhs user USER_ID # {code: -1}
xhs user-posts USER_ID # {code: -1}
xhs favorites # API error
```

###

> **install**: `pipx install xiaohongshu-cli` `xhs login` Cookie
>
> **xsec_token **: XiaoHongShu xsec_token ** note_id ** `xhs search` `xhs feed` URL/ID `xhs read` note_id 
>
> ****: searchcomments 2-3 
>
> **POST **: (post)comments(comment)(like) v0.6.x 406 v0.3.5 (`pipx install xiaohongshu-cli==0.3.5`)

## Douyin / Douyin

```bash
# videoInfo
mcporter call 'douyin.parse_douyin_video_info(share_link: "https://v.douyin.com/xxx/")'

# link
mcporter call 'douyin.get_douyin_download_link(share_link: "https://v.douyin.com/xxx/")'

# video
mcporter call 'douyin.extract_douyin_text(share_link: "https://v.douyin.com/xxx/")'
```

> ****

## Twitter/X (twitter-cli)

###

```bash
# time
twitter feed -n 20

twitter tweet URL_OR_ID

# / X Article
twitter article URL_OR_ID

# usertime
twitter user-posts @username -n 20

# user
twitter user @username
```

###

```bash
# searchTwitter GraphQL 404
twitter search "query" -n 10
# search 404 twitter-clipipx upgrade twitter-cli

# likes2024
twitter likes
```

###

> **install**: `pipx install twitter-cli` v0.8.5+
>
> ****: Cookie-Editor `TWITTER_AUTH_TOKEN` + `TWITTER_CT0` SSH/Docker/Available
>
> **IP **: VPS/ IP followers/followingproxy
>
> **search **: Twitter GraphQL APIsearch 404 `pipx upgrade twitter-cli` Twitter `twitter feed` 
>
> ****: `--yaml` `--json` AI agent 

## Weibo / Weibo

```bash
# Jina Reader
curl -s "https://r.jina.ai/https://weibo.com/USER_ID/POST_ID"
```

> Weibo

## Bilibili / Bilibili

```bash
# video
yt-dlp --dump-json "https://www.bilibili.com/video/BVxxx"

yt-dlp --write-sub --write-auto-sub --sub-lang "zh-Hans,zh,en" --convert-subs vtt --skip-download -o "/tmp/%(id)s" "URL"
```

> ****: IP 412 Error `--cookies-from-browser chrome` configureproxy

## V2EX ( API)

 API

###

```bash
curl -s "https://www.v2ex.com/api/topics/hot.json" -H "User-Agent: agent-search/1.0"
```

###

```bash
# node_name : python, tech, jobs, qna, programmers
curl -s "https://www.v2ex.com/api/topics/show.json?node_name=python&page=1" -H "User-Agent: agent-search/1.0"
```

###

```bash
# topic_id URL https://www.v2ex.com/t/1234567
curl -s "https://www.v2ex.com/api/topics/show.json?id=TOPIC_ID" -H "User-Agent: agent-search/1.0"
```

###

```bash
curl -s "https://www.v2ex.com/api/replies/show.json?topic_id=TOPIC_ID&page=1" -H "User-Agent: agent-search/1.0"
```

### userInfo

```bash
curl -s "https://www.v2ex.com/api/members/show.json?username=USERNAME" -H "User-Agent: agent-search/1.0"
```

### Python

```python
from agent_search.channels.v2ex import V2EXChannel

ch = V2EXChannel()

# post
topics = ch.get_hot_topics(limit=10)
for t in topics:
 print(f[{t['node_title']}] {t['title']} ({t['replies']} ))

# post
node_topics = ch.get_node_topics("python", limit=5)

# post +
topic = ch.get_topic(1234567)
print(topic["title"], "—", topic["author"])

# userInfo
user = ch.get_user("Livid")
```

> ****: https://www.v2ex.com/planes

## Reddit (rdt-cli)

```bash
# searchpost
rdt search "query" --limit 10

# post + comments
rdt read POST_ID

# subreddit
rdt sub python --limit 20

rdt popular --limit 10

# /r/all
rdt all --limit 10
```

> **install**: `pipx install rdt-cli` v0.4.2+search
> Login required`rdt feed --subs-only``rdt saved`
> `--yaml` AI agent 
