本项目抓取 x_curl/ 中的 X GraphQL curl,解析 @aleabitoreddit 的帖子、回复、订阅帖,抽取 $SYMBOL,写入本地 SQLite,并用 Yahoo chart 接口下载日线价格。
如果你不想自己搭建本地环境,可以订阅 @iamai_omni,然后访问 app.k2ai.dev 直接使用托管版。也可以扫码直接打开订阅页:
本项目仅用于研究和可视化,不构成投资建议。
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
python3 scripts/ingest.py all --max-pages 10 --days 500 --min-mentions 3
python3 scripts/server.py --port 8787打开 http://127.0.0.1:8787。
scripts/ingest.py fetch-x 会读取 x_curl/ 目录中的浏览器请求。首次使用或登录态过期时,需要从 Chrome DevTools 重新复制。
- 用 Chrome 登录 X,并打开
https://x.com/aleabitoreddit。 - 打开 DevTools:
F12或Cmd/Ctrl + Shift + I。 - 切到
Network面板,筛选Fetch/XHR,也可以在过滤框输入UserTweets。 - 刷新页面,滚动几次,触发帖子、回复或订阅内容加载。
- 找到以下 GraphQL 请求,右键选择
Copy->Copy as cURL。 - 分别保存为这些文件名:
x_curl/UserTweets.curl
x_curl/UserTweetsAndReplies.curl
x_curl/UserSuperFollowTweets.curl
大致样例,真实内容会更长,并包含你的 cookie/token:
mkdir -p x_curl
cat > x_curl/UserTweets.curl <<'EOF_CURL'
curl 'https://x.com/i/api/graphql/.../UserTweets?variables=...&features=...' \
-H 'authorization: Bearer ...' \
-H 'cookie: auth_token=...; ct0=...' \
-H 'x-csrf-token: ...' \
-H 'x-twitter-active-user: yes'
EOF_CURL注意:x_curl/*.curl 包含登录 cookie/token,已经被 .gitignore 忽略;不要提交或分享这些文件。
- SQLite:
data/serenity.sqlite - 原始 X JSON:
data/raw/*.json - Dashboard:
dashboard/index.html,dashboard/styles.css,dashboard/app.js
python3 scripts/ingest.py fetch-x --max-pages 20
python3 scripts/ingest.py prices --days 700 --min-mentions 2
python3 scripts/ingest.py stats注意:x_curl/*.curl 内的登录态可能过期;若抓取返回空或报错,重新从浏览器复制 curl 后再运行。
本仓库内置了可开源分发的 Codex skill:skills/serenity-stock-scorer。它会基于本地 Serenity SQLite 快照,对单个 ticker 输出 0-100 的 Serenity 语料信号分。
python3 skills/serenity-stock-scorer/scripts/score_serenity_stock.py NVDA --pretty该 skill 默认查找 data/serenity.sqlite;如果数据库在其他位置,可以传 --db /path/to/serenity.sqlite 或设置 SERENITY_DB_PATH。
This project reads X GraphQL curl commands from x_curl/, parses posts, replies, and premium posts from @aleabitoreddit, extracts $SYMBOL mentions, stores them in a local SQLite database, and downloads daily price bars from Yahoo's chart API.
If you do not want to set up the local project yourself, subscribe to @iamai_omni, then visit app.k2ai.dev to use the hosted version directly. You can also scan this QR code to open the subscription page:
This project is for research and visualization only. It is not financial advice.
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
python3 scripts/ingest.py all --max-pages 10 --days 500 --min-mentions 3
python3 scripts/server.py --port 8787Open http://127.0.0.1:8787.
scripts/ingest.py fetch-x reads browser-copied requests from x_curl/. You need to refresh these files when setting up the project or when the X session expires.
- Log in to X with Chrome and open
https://x.com/aleabitoreddit. - Open DevTools with
F12orCmd/Ctrl + Shift + I. - Go to
Network, selectFetch/XHR, and optionally filter byUserTweets. - Refresh the page and scroll a few times so X loads posts, replies, or premium content.
- Find the GraphQL requests below, right-click each one, then choose
Copy->Copy as cURL. - Save them with these exact filenames:
x_curl/UserTweets.curl
x_curl/UserTweetsAndReplies.curl
x_curl/UserSuperFollowTweets.curl
Approximate example; the real command is longer and includes your cookie/token values:
mkdir -p x_curl
cat > x_curl/UserTweets.curl <<'EOF_CURL'
curl 'https://x.com/i/api/graphql/.../UserTweets?variables=...&features=...' \
-H 'authorization: Bearer ...' \
-H 'cookie: auth_token=...; ct0=...' \
-H 'x-csrf-token: ...' \
-H 'x-twitter-active-user: yes'
EOF_CURLWarning: x_curl/*.curl contains login cookies/tokens and is ignored by .gitignore. Do not commit or share these files.
- SQLite:
data/serenity.sqlite - Raw X JSON:
data/raw/*.json - Dashboard:
dashboard/index.html,dashboard/styles.css,dashboard/app.js
python3 scripts/ingest.py fetch-x --max-pages 20
python3 scripts/ingest.py prices --days 700 --min-mentions 2
python3 scripts/ingest.py statsIf X fetching returns empty or invalid responses, copy fresh curl commands from Chrome and run the ingestion again.
This repo includes an open-source-ready Codex skill at skills/serenity-stock-scorer. It scores a single ticker from the local Serenity SQLite snapshot as a 0-100 Serenity corpus signal.
python3 skills/serenity-stock-scorer/scripts/score_serenity_stock.py NVDA --prettyThe skill looks for data/serenity.sqlite by default. If your database lives elsewhere, pass --db /path/to/serenity.sqlite or set SERENITY_DB_PATH.

