Skip to content

Repository files navigation

299792457_ archive

An image archive of @299792457_, rendered with twitter-snap.

The archive also includes an interactive activity dashboard built from the searchable JSON records with pandas and Plotly.

Archived post 2022276975130501251

How it works

GitHub Actions runs hourly. It uses @yuta/bird through Twitter Safe Relay to enumerate post IDs, renders each new status with twitter-snap's exported getSnapAppRenderWithCache API and guest session, and commits each record to snapshots/YYYY/MM/<tweet-id>.<png|mp4> with a searchable <tweet-id>.json sidecar produced by twitter-snap's Json theme. JSON is pretty-printed for readable diffs and repository search. Image posts remain 2x-resolution PNGs and video posts are rendered as MP4s. Posts and authored replies are both collected from UserTweetsAndReplies, including replies to other accounts and continuations of a self-thread. Each status in a thread is archived as its own addressable record. The library API reuses the guest session and font cache across posts in one run.

After collecting posts, the same workflow rebuilds dashboard/index.html. The dashboard summarizes daily activity, posting times in Japan Standard Time, and frequent reply recipients. Its output is deterministic, so runs without new archive data do not create commits.

Only ID enumeration is authenticated by the home relay. Rendering uses a guest token, so X cookies are never copied into GitHub Actions. The collector stops after five consecutive existing authored IDs and renders at most 40 new posts or replies per run.

Setup

Enter the Nix development shell to get Node.js, pnpm, FFmpeg, Python, and uv. FFmpeg is required to render video posts and is also installed by GitHub Actions:

nix develop

Add the repository Actions secrets TS_OAUTH_CLIENT_ID and TS_OAUTH_SECRET. The OAuth client must allow tag:ci nodes to join the tailnet and reach tw.home.yutakobayashi.com.

Run a snapshot locally with:

pnpm install --frozen-lockfile
pnpm snapshot

Build the dashboard locally with:

uv sync --locked
uv run --locked python scripts/build_dashboard.py

Run the dashboard tests with:

uv run --locked python -m unittest discover -s tests -v

Rebuild every existing PNG or MP4 at 2x resolution with:

pnpm snapshot -- --rebuild

Backfill every missing authored post, including replies, through Safe Relay's paginated UserTweetsAndReplies timeline with:

pnpm snapshot -- --backfill

Backfill missing JSON sidecars for up to 40 existing snapshots per run with:

pnpm snapshot -- --backfill-json

You can also start the Archive X snapshots workflow manually from the Actions tab. Scheduled and manual runs operate only on the default branch.

Contributing

Keep both dependencies pinned. Before opening a pull request, run pnpm install --frozen-lockfile and verify that pnpm snapshot creates a non-empty PNG or MP4 with a matching, valid JSON sidecar. Update this README when the schedule, target, output layout, or required secret changes.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages