Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(x): add the archive refresh runner and widen the analysis to every account
nirholas9bef96d6122d
diff --git a/api/_lib/migrations/20260814120000_x_account_archive.sql b/api/_lib/migrations/20260814120000_x_account_archive.sqlindex 6b3b42b23..5ccc05d01 100644--- a/api/_lib/migrations/20260814120000_x_account_archive.sql+++ b/api/_lib/migrations/20260814120000_x_account_archive.sql@@ -80,7 +80,11 @@ create table if not exists x_account_posts (views_label text,views_exact boolean not null default false,- measured_at timestamptz, -- scrape time behind the metrics above+ -- 'scrape' (timeline, counters may be late or rounded) or 'x-api-v2'+ -- (public_metrics, exact). The analysis trusts a zero from the API and+ -- distrusts a zero from a scrape, so provenance has to survive the write.+ metrics_source text not null default 'scrape',+ measured_at timestamptz, -- when the metrics above were observedfirst_seen_at timestamptz not null default now(),updated_at timestamptz not null default now());@@ -99,11 +103,12 @@ create table if not exists x_account_post_snapshots (tweet_id text not null references x_account_posts(tweet_id) on delete cascade,import_id uuid not null references x_account_imports(id) on delete cascade,captured_at timestamptz not null,- likes integer,- retweets integer,- replies integer,- views integer,- views_label text+ likes integer,+ retweets integer,+ replies integer,+ views integer,+ views_label text,+ metrics_source text not null default 'scrape');-- One measurement per post per scrape instant. A re-import of the same file isdiff --git a/docs/x-archive/trythreews-engagement.md b/docs/x-archive/trythreews-engagement.mdindex 761747e7e..c6b85845f 100644--- a/docs/x-archive/trythreews-engagement.md+++ b/docs/x-archive/trythreews-engagement.md@@ -3,45 +3,57 @@Generated by `npm run x:archive:analyze` from the post archive in [data/x-archive/](../../data/x-archive/). Do not hand-edit: rerun the script after the next scrape.- **Source:** archive files (data/x-archive/trythreews-2026-08-14.json)-- **Generated:** 2026-08-14T06:08:05.394Z-- **Corpus:** 214 posts written by @trythreews, 2026-04-29 to 2026-08-12. 145 reposts and quotes of other accounts are archived but excluded from every number below: they carry the original author's engagement, not ours.+- **Generated:** 2026-08-14T06:11:36.194Z+- **Corpus:** 158 posts written by @trythreews, 2026-04-29 to 2026-08-12.+- **Excluded:** 145 reposts and quotes of other accounts (they carry the original author's engagement, not ours) and 56 of our own posts whose scraped like count is not believable (see the data-quality note below).- **Engagements** here means likes + reposts + replies. Views measure delivery, engagements measure whether anyone cared.- **View counts are rounded by X itself** past 999 ("6.3K"), so every rate below carries about two significant figures. Exact counts under 1,000 are exact.+### Data quality++56 of 214 own posts came back with 0 likes despite real reach or replies, which the timeline scraper does when the like counter has not rendered yet. They are archived but left out of every measurement here rather than dragging the medians down. Highest-reach examples:++- [2026-05-13](https://x.com/trythreews/status/2054675701132132736) - 172,000 views, 92 replies, 0 likes recorded+- [2026-07-28](https://x.com/trythreews/status/2082227422850941395) - 157,000 views, 70 replies, 0 likes recorded+- [2026-06-09](https://x.com/trythreews/status/2064242904428925036) - 88,000 views, 41 replies, 0 likes recorded+- [2026-06-01](https://x.com/trythreews/status/2061450827672514602) - 76,000 views, 18 replies, 0 likes recorded+- [2026-05-02](https://x.com/trythreews/status/2050585585191186781) - 71,000 views, 16 replies, 0 likes recorded++Fix: `npm run x:archive:refresh` pulls exact counts for every archived post straight from the X API (needs `X_API_BEARER`) and writes them back as a new archive snapshot. Rerun this analysis afterwards and the exclusions disappear.+## Headline| Metric | Value ||---|---:|-| Posts analyzed | 214 |+| Posts analyzed | 158 || Total likes | 3,451 |-| Total reposts | 899 |-| Total replies | 1,141 |-| Total views (approx) | 1,380,518 |+| Total reposts | 640 |+| Total replies | 213 |+| Total views (approx) | 218,309 || Median engagements per post | 12 |-| Mean engagements per post | 25.7 |-| p75 / p90 / p99 | 29 / 62 / 266 |+| Mean engagements per post | 27.2 |+| p75 / p90 / p99 | 31 / 67 / 266 || Best post | 359 |-| Median engagement rate | 1.37% of views (214 posts with a view count) |-| Share of engagement from the top 10% of posts | 49.2% |+| Median engagement rate | 2.19% of views (158 posts with a view count) |+| Share of engagement from the top 10% of posts | 49.4% |## The read-off-- **Names $THREE** carries: 6 posts at a median 44 engagements (3.67x the corpus median) against 11 for the 208 without it.-- **Has an image** carries: 41 posts at a median 25 engagements (2.08x the corpus median) against 10 for the 173 without it.-- **Mentions an account** carries: 45 posts at a median 22 engagements (1.83x the corpus median) against 10 for the 169 without it.-- **Is a reply** costs: 17 posts at a median 5 (0.42x) against 12 without.-- **Text only** costs: 149 posts at a median 10 (0.83x) against 16 without.-- Best-performing subject: **Industry commentary** (6 posts, median 46, 3.79x). Weakest: **Other** (143 posts, median 10, 0.83x).-- Best length band: **100-179 chars** (24 posts, 1.88x). Worst: **1-99 chars** (0.75x).-- Strongest posting hour: **01:00 UTC** (5 posts, 3.50x). Weakest: **06:00 UTC** (0.38x).-- Concentration: the top 10% of posts earn **49.2%** of all engagement. Median post: 12 engagements; p90: 62; best: 359.+- **Mentions an account** carries: 21 posts at a median 54 engagements (4.50x the corpus median) against 10 for the 137 without it.+- **Multi-paragraph** carries: 36 posts at a median 33 engagements (2.75x the corpus median) against 10 for the 122 without it.+- **Has an image** carries: 14 posts at a median 28 engagements (2.33x the corpus median) against 12 for the 144 without it.+- **Text only** costs: 132 posts at a median 11 (0.88x) against 23 without.+- **Is a reply** costs: 17 posts at a median 5 (0.42x) against 13 without.+- Best-performing subject: **Shipped / changelog** (5 posts, median 30, 2.50x). Weakest: **Other** (123 posts, median 10, 0.83x).+- Best length band: **100-179 chars** (17 posts, 3.00x). Worst: **1-99 chars** (0.83x).+- Strongest posting hour: **08:00 UTC** (7 posts, 2.75x). Weakest: **21:00 UTC** (0.17x).+- Concentration: the top 10% of posts earn **49.4%** of all engagement. Median post: 12 engagements; p90: 67; best: 359.## Top 15 posts by engagement| Date | Post | Likes | RT | Replies | Eng. | Signals ||---|---|---:|---:|---:|---:|---|| 2026-08-07 | [Today: The first in-world meetup of the http:// Three.ws User Group hosted by @IBM Open h…](https://x.com/trythreews/status/2085684765286637618) | 228 | 90 | 41 | 359 | video, @1, token, avatar |-| 2026-05-13 | [We just reverse engineered the @pumpfun agent payments SDK Your AI doesn't just execute t…](https://x.com/trythreews/status/2054675701132132736) | 0 | 201 | 92 | 293 | video, @1, avatar, agent, payments || 2026-08-12 | [three․ws is now verified on @fomo What that means in practice: search THREE in the fomo a…](https://x.com/trythreews/status/2087646652056432688) | 187 | 63 | 16 | 266 | image, @1, token, partner || 2026-06-04 | [MCP Servers are live on the official @AnthropicAI MCP Registry https:// registry.modelcon…](https://x.com/trythreews/status/2062326562775531744) | 202 | 27 | 12 | 241 | text, @1, reply, agent || 2026-06-22 | [Important links from the video ▸ Try the modal live (real 402 → sign → settle) https:// t…](https://x.com/trythreews/status/2068961439465796028) | 139 | 49 | 9 | 197 | card, @1, agent, payments |@@ -51,10 +63,11 @@ Generated by `npm run x:archive:analyze` from the post archive in [data/x-archiv| 2026-07-28 | [Thank you @solana @OpenAI and all of our partners, community members, and developers that…](https://x.com/trythreews/status/2082234618842079558) | 73 | 13 | 4 | 90 | text, @2, partner || 2026-07-16 | [](https://x.com/trythreews/status/2077891066762756376) | 72 | 18 | n/a | 90 | card, other || 2026-06-16 | [with on-chain reputation, know you are transacting with good ai just as you would any ser…](https://x.com/trythreews/status/2066782180492390665) | 76 | 11 | 1 | 88 | text, other |-| 2026-06-22 | [Give your agents access to money We just shipped a drop-in payment modal for any x402 pai…](https://x.com/trythreews/status/2068951336918638699) | 0 | 0 | 84 | 84 | video, agent, payments, shipping, commentary || 2026-06-06 | [Can't wait](https://x.com/trythreews/status/2063249039316140141) | 71 | 6 | 2 | 79 | text, other || 2026-07-05 | [hello @elonmusk](https://x.com/trythreews/status/2073812694600384788) | 58 | 8 | 5 | 71 | text, @1, other |-| 2026-07-28 | [http:// three.ws has been named an OpenAI Partner. As part of the OpenAI Partner Network,…](https://x.com/trythreews/status/2082227422850941395) | 0 | 0 | 70 | 70 | image, partner |+| 2026-07-11 | [And to the community: You didn't watch this get built. You built it. The next chapter is …](https://x.com/trythreews/status/2075835576763515356) | 49 | 18 | 2 | 69 | text, other |+| 2026-07-10 | [Guardrails and safety measures for all autonomous agents. Video incoming.](https://x.com/trythreews/status/2075478948625182991) | 55 | 13 | 1 | 69 | image, agent |+| 2026-08-07 | [Read more about this event in the thread posted by @nichxbt on our @IBM user group https:…](https://x.com/trythreews/status/2085686157204197574) | 54 | 13 | 1 | 68 | text, @2, other |## Highest engagement rate (500+ views)@@ -77,16 +90,16 @@ Rate normalizes for reach, so this is the list of posts that converted the atten| Date | Post | Likes | RT | Replies | Eng. | Signals ||---|---|---:|---:|---:|---:|---|-| 2026-05-13 | [We just reverse engineered the @pumpfun agent payments SDK Your AI doesn't just execute t…](https://x.com/trythreews/status/2054675701132132736) | 0 | 201 | 92 | 293 | video, @1, avatar, agent, payments |-| 2026-06-22 | [Give your agents access to money We just shipped a drop-in payment modal for any x402 pai…](https://x.com/trythreews/status/2068951336918638699) | 0 | 0 | 84 | 84 | video, agent, payments, shipping, commentary |-| 2026-07-28 | [http:// three.ws has been named an OpenAI Partner. As part of the OpenAI Partner Network,…](https://x.com/trythreews/status/2082227422850941395) | 0 | 0 | 70 | 70 | image, partner |-| 2026-07-31 | [We’ve been featured in @VogueMagazine Photo Vogue! http:// three.ws is now officially rec…](https://x.com/trythreews/status/2083234861184397693) | 0 | 0 | 48 | 48 | image, @1, agent |-| 2026-07-18 | [IBM just gave three․ws its own corner of IBM․com An official community on IBM's platform,…](https://x.com/trythreews/status/2078321037868167313) | 0 | 0 | 46 | 46 | image, @1, other |-| 2026-07-06 | [We just shipped 3,000+ animations for 3D AI Agents. http:// three.ws is now officially th…](https://x.com/trythreews/status/2073943451499131112) | 0 | 0 | 42 | 42 | video, avatar, agent, shipping || 2026-08-07 | [Today: The first in-world meetup of the http:// Three.ws User Group hosted by @IBM Open h…](https://x.com/trythreews/status/2085684765286637618) | 228 | 90 | 41 | 359 | video, @1, token, avatar |-| 2026-06-09 | [333 of the first 3D avatars ever created on three․ws are now on-chain, forever. Each one …](https://x.com/trythreews/status/2064242904428925036) | 0 | 0 | 41 | 41 | image, @2, avatar, agent, payments, partner |-| 2026-08-04 | [@GoogleCloud three․ws We are excited to announce we are joining forces with Google Cloud!…](https://x.com/trythreews/status/2084704775665566007) | 0 | 0 | 36 | 36 | video, @1, avatar |-| 2026-06-18 | [](https://x.com/trythreews/status/2067553231967031646) | 0 | 0 | 33 | 33 | text, other |+| 2026-08-12 | [three․ws is now verified on @fomo What that means in practice: search THREE in the fomo a…](https://x.com/trythreews/status/2087646652056432688) | 187 | 63 | 16 | 266 | image, @1, token, partner |+| 2026-06-04 | [MCP Servers are live on the official @AnthropicAI MCP Registry https:// registry.modelcon…](https://x.com/trythreews/status/2062326562775531744) | 202 | 27 | 12 | 241 | text, @1, reply, agent |+| 2026-06-25 | [More co-marketing with IBM coming](https://x.com/trythreews/status/2069961582759829808) | 114 | 43 | 11 | 168 | text, other |+| 2026-06-22 | [Important links from the video ▸ Try the modal live (real 402 → sign → settle) https:// t…](https://x.com/trythreews/status/2068961439465796028) | 139 | 49 | 9 | 197 | card, @1, agent, payments |+| 2026-07-16 | [this is us coded](https://x.com/trythreews/status/2077791336561070434) | 33 | 1 | 5 | 39 | text, other |+| 2026-07-07 | [thanks, Toly!](https://x.com/trythreews/status/2074462590663877096) | 27 | 5 | 5 | 37 | text, other |+| 2026-07-05 | [hello @elonmusk](https://x.com/trythreews/status/2073812694600384788) | 58 | 8 | 5 | 71 | text, @1, other |+| 2026-05-10 | [Just a warm up.](https://x.com/trythreews/status/2053515313464160487) | 9 | 4 | 5 | 18 | text, other |+| 2026-07-30 | [Everyone will know soon. Thanks, 0ya!](https://x.com/trythreews/status/2082934921983873310) | 41 | 10 | 4 | 55 | text, commentary |## What correlates with engagement@@ -94,25 +107,24 @@ Lift is the group's median engagements divided by the corpus median. Rows are on| Signal | With | Median (with) | Lift | Without | Median (without) | Lift ||---|---:|---:|---:|---:|---:|---:|-| Names $THREE | 6 | 44 | 3.67x | 208 | 11 | 0.92x |-| Has an image | 41 | 25 | 2.08x | 173 | 10 | 0.83x |-| Mentions an account | 45 | 22 | 1.83x | 169 | 10 | 0.83x |-| Has a video | 17 | 21 | 1.75x | 197 | 11 | 0.92x |-| Multi-paragraph | 74 | 21 | 1.71x | 140 | 9 | 0.75x |-| Contains a link | 36 | 17 | 1.38x | 178 | 11 | 0.88x |-| Text only | 149 | 10 | 0.83x | 65 | 16 | 1.33x |-| Has a link card | 24 | 9 | 0.71x | 190 | 12 | 1.00x |-| Asks a question | 10 | 7 | 0.58x | 204 | 12 | 1.00x |-| Is a reply | 17 | 5 | 0.42x | 197 | 12 | 1.00x |+| Mentions an account | 21 | 54 | 4.50x | 137 | 10 | 0.83x |+| Multi-paragraph | 36 | 33 | 2.75x | 122 | 10 | 0.79x |+| Has an image | 14 | 28 | 2.33x | 144 | 12 | 0.96x |+| Contains a link | 18 | 28 | 2.29x | 140 | 11 | 0.92x |+| Has a link card | 12 | 17 | 1.42x | 146 | 12 | 1.00x |+| Text only | 132 | 11 | 0.88x | 26 | 23 | 1.92x |+| Asks a question | 7 | 10 | 0.83x | 151 | 12 | 1.00x |+| Has a video | 6 | 9 | 0.71x | 152 | 13 | 1.04x |+| Is a reply | 17 | 5 | 0.42x | 141 | 13 | 1.08x |### By length| Length | Posts | Median | Mean | Best | Lift ||---|---:|---:|---:|---:|---:|-| 1-99 chars | 138 | 9 | 15.9 | 168 | 0.75x |-| 100-179 chars | 24 | 23 | 42.4 | 241 | 1.88x |-| 180-279 chars | 48 | 16 | 41.7 | 359 | 1.29x |-| 280-499 chars | 4 | 71 | 70.5 | 111 | 5.88x |+| 1-99 chars | 121 | 10 | 16.9 | 168 | 0.83x |+| 100-179 chars | 17 | 36 | 54.1 | 241 | 3.00x |+| 180-279 chars | 17 | 20 | 67.2 | 359 | 1.67x |+| 280-499 chars | 3 | 57 | 66.0 | 111 | 4.75x || 500+ chars | 0 | n/a | n/a | n/a | n/a |### By subject@@ -121,81 +133,76 @@ A post can carry more than one subject, so the counts sum past the corpus size.| Subject | Posts | Median | Mean | Best | Lift ||---|---:|---:|---:|---:|---:|-| Industry commentary | 6 | 46 | 43.3 | 84 | 3.79x |-| Token / $THREE | 8 | 32 | 98.9 | 359 | 2.63x |-| Shipped / changelog | 9 | 30 | 38.1 | 111 | 2.50x |-| Partner / ecosystem | 15 | 29 | 46.5 | 266 | 2.42x |-| Agents | 43 | 18 | 40.2 | 293 | 1.50x |-| Avatars / 3D | 30 | 17 | 42.1 | 359 | 1.42x |-| Payments / x402 | 21 | 12 | 45.6 | 293 | 1.00x |-| Build log / behind the scenes | 4 | 11 | 11.0 | 16 | 0.88x |-| Other | 143 | 10 | 16.6 | 168 | 0.83x |+| Token / $THREE | 4 | 160 | 178.3 | 359 | 13.33x |+| Partner / ecosystem | 4 | 76 | 113.5 | 266 | 6.33x |+| Industry commentary | 3 | 55 | 49.3 | 57 | 4.58x |+| Shipped / changelog | 5 | 30 | 41.4 | 111 | 2.50x |+| Agents | 17 | 25 | 54.5 | 241 | 2.08x |+| Avatars / 3D | 10 | 23 | 63.9 | 359 | 1.92x |+| Build log / behind the scenes | 2 | 12 | 11.5 | 16 | 0.96x |+| Payments / x402 | 9 | 11 | 48.4 | 197 | 0.92x |+| Other | 123 | 10 | 17.6 | 168 | 0.83x |## Timing (UTC)| Hour | Posts | Median | Lift ||---:|---:|---:|---:|-| 00:00 | 9 | 10 | 0.83x |-| 01:00 | 5 | 42 | 3.50x |-| 02:00 | 6 | 6 | 0.50x |-| 03:00 | 2 | 24 | 2.00x |-| 04:00 | 9 | 7 | 0.58x |-| 05:00 | 4 | 19 | 1.54x |-| 06:00 | 22 | 5 | 0.38x |-| 07:00 | 21 | 15 | 1.25x |-| 08:00 | 9 | 22 | 1.83x |-| 09:00 | 6 | 13 | 1.08x |-| 10:00 | 4 | 17 | 1.42x |-| 11:00 | 25 | 17 | 1.42x |-| 12:00 | 7 | 6 | 0.50x |-| 13:00 | 5 | 16 | 1.33x |-| 14:00 | 8 | 13 | 1.08x |-| 15:00 | 3 | 20 | 1.67x |-| 16:00 | 8 | 33 | 2.71x |+| 00:00 | 5 | 10 | 0.83x |+| 01:00 | 2 | 115 | 9.54x |+| 02:00 | 5 | 7 | 0.58x |+| 03:00 | 1 | 2 | 0.17x |+| 04:00 | 8 | 7 | 0.58x |+| 05:00 | 2 | 19 | 1.54x |+| 06:00 | 16 | 5 | 0.38x |+| 07:00 | 17 | 15 | 1.25x |+| 08:00 | 7 | 33 | 2.75x |+| 09:00 | 5 | 14 | 1.17x |+| 10:00 | 3 | 10 | 0.83x |+| 11:00 | 21 | 17 | 1.42x |+| 12:00 | 6 | 8 | 0.63x |+| 13:00 | 2 | 40 | 3.33x |+| 14:00 | 3 | 23 | 1.92x |+| 15:00 | 2 | 10 | 0.83x |+| 16:00 | 6 | 33 | 2.71x || 17:00 | 3 | 40 | 3.33x |-| 18:00 | 8 | 16 | 1.33x |-| 19:00 | 12 | 12 | 0.96x |+| 18:00 | 6 | 13 | 1.04x |+| 19:00 | 10 | 12 | 1.00x || 20:00 | 5 | 9 | 0.75x |-| 21:00 | 13 | 8 | 0.67x |-| 22:00 | 9 | 29 | 2.42x |-| 23:00 | 11 | 16 | 1.33x |+| 21:00 | 9 | 2 | 0.17x |+| 22:00 | 6 | 33 | 2.75x |+| 23:00 | 8 | 20 | 1.67x || Weekday | Posts | Median | Lift ||---|---:|---:|---:|-| Sun | 23 | 10 | 0.83x |-| Mon | 24 | 13 | 1.08x |-| Tue | 37 | 9 | 0.75x |-| Wed | 26 | 12 | 0.96x |-| Thu | 45 | 14 | 1.17x |-| Fri | 35 | 11 | 0.92x |-| Sat | 24 | 13 | 1.08x |+| Sun | 22 | 10 | 0.83x |+| Mon | 17 | 13 | 1.08x |+| Tue | 26 | 9 | 0.75x |+| Wed | 18 | 13 | 1.04x |+| Thu | 34 | 15 | 1.25x |+| Fri | 24 | 14 | 1.17x |+| Sat | 17 | 12 | 1.00x |## Cadence by month| Month | Posts | Median | Mean | Best ||---|---:|---:|---:|---:|-| 2026-04 | 10 | 7 | 7.7 | 14 |-| 2026-05 | 29 | 10 | 20.8 | 293 |-| 2026-06 | 85 | 10 | 22.5 | 241 |-| 2026-07 | 70 | 16 | 26.6 | 111 |-| 2026-08 | 20 | 18 | 51.9 | 359 |+| 2026-04 | 8 | 6 | 6.8 | 14 |+| 2026-05 | 14 | 12 | 11.5 | 36 |+| 2026-06 | 64 | 11 | 24.9 | 241 |+| 2026-07 | 56 | 16 | 27.4 | 111 |+| 2026-08 | 16 | 18 | 60.1 | 359 |## Accounts we mention (2+ posts)| Account | Posts mentioning | Mean engagements ||---|---:|---:|| @fomo | 2 | 160.0 |-| @ibm | 7 | 82.3 |-| @pumpfun | 6 | 71.2 |-| @anthropicai | 5 | 63.2 |-| @three | 2 | 61.0 |+| @ibm | 3 | 159.0 |+| @anthropicai | 3 | 92.0 || @solana | 2 | 50.0 || @nichxbt | 2 | 36.0 |+| @pumpfun | 3 | 31.0 || @trythreews | 2 | 30.5 |-| @metaplex | 2 | 28.0 |-| @coincomms | 2 | 21.0 |-| @coinmarketcap | 3 | 11.7 |-| @spotify | 2 | 6.0 |## Accounts we repost or quote@@ -227,7 +234,6 @@ The floor is as instructive as the ceiling: these are the shapes to stop repeati|---|---|---:|---:|---:|---:|---|| 2026-08-04 | ["Google vetted http:// three.ws, and http:// three.ws passed."](https://x.com/trythreews/status/2084720030051405828) | 0 | 0 | n/a | 0 | card, other || 2026-07-25 | [](https://x.com/trythreews/status/2081033827636711670) | 0 | n/a | n/a | 0 | card, other |-| 2026-07-11 | [We are thrilled to announce http:// three.ws has been accepted into the NVIDIA Developer …](https://x.com/trythreews/status/2075835958889685499) | 0 | 0 | n/a | 0 | image, @1, avatar || 2026-07-10 | [banger](https://x.com/trythreews/status/2075729204147298776) | 0 | n/a | n/a | 0 | text, reply, other || 2026-06-25 | [](https://x.com/trythreews/status/2070014575924363514) | 0 | 0 | n/a | 0 | text, other || 2026-06-16 | [](https://x.com/trythreews/status/2066795399055331684) | 0 | n/a | n/a | 0 | text, other |@@ -235,3 +241,4 @@ The floor is as instructive as the ceiling: these are the shapes to stop repeati| 2026-06-16 | [](https://x.com/trythreews/status/2066781386732978422) | 0 | n/a | n/a | 0 | text, other || 2026-05-22 | [](https://x.com/trythreews/status/2057781368780927471) | 0 | n/a | n/a | 0 | text, reply, other || 2026-05-11 | [](https://x.com/trythreews/status/2053700891186983198) | 0 | n/a | n/a | 0 | text, other |+| 2026-08-07 | [1 hour](https://x.com/trythreews/status/2085727970111693227) | 0 | 0 | 1 | 1 | text, other |diff --git a/scripts/x-archive-analyze.mjs b/scripts/x-archive-analyze.mjsindex 21bd5d83c..1ca0f18ae 100644--- a/scripts/x-archive-analyze.mjs+++ b/scripts/x-archive-analyze.mjs@@ -84,7 +84,7 @@ async function loadFromDb() {select tweet_id, handle, author_handle, url, text, posted_at,is_retweet, is_reply, is_pinned, has_image, has_video, has_card,hashtags, mentions, urls,- likes, retweets, replies, views, views_label, views_exact, measured_at+ likes, retweets, replies, views, views_label, views_exact, metrics_source, measured_atfrom x_account_postsorder by posted_at desc`;@@ -114,6 +114,7 @@ async function loadFromDb() {views: r.views,viewsLabel: r.views_label,viewsExact: r.views_exact,+ metricsSource: r.metrics_source,measuredAt: r.measured_at ? new Date(r.measured_at).toISOString() : null,};if (!accounts.has(r.handle)) {diff --git a/scripts/x-archive-import.mjs b/scripts/x-archive-import.mjsindex d7befc3ea..d14a9903d 100644--- a/scripts/x-archive-import.mjs+++ b/scripts/x-archive-import.mjs@@ -101,12 +101,12 @@ async function importScrape(client, scrape) {tweet_id, handle, author_handle, url, text, posted_at,is_retweet, is_reply, is_pinned, has_image, has_video, has_card,hashtags, mentions, urls,- likes, retweets, replies, views, views_label, views_exact, measured_at+ likes, retweets, replies, views, views_label, views_exact, metrics_source, measured_at) values ($1, $2, $3, $4, $5, $6,$7, $8, $9, $10, $11, $12,$13, $14, $15,- $16, $17, $18, $19, $20, $21, $22+ $16, $17, $18, $19, $20, $21, $22, $23)on conflict (tweet_id) do update seturl = excluded.url,@@ -121,6 +121,7 @@ async function importScrape(client, scrape) {views = excluded.views,views_label = excluded.views_label,views_exact = excluded.views_exact,+ metrics_source = excluded.metrics_source,measured_at = excluded.measured_at,updated_at = now()-- Only accept a scrape that is newer than the one already on the@@ -133,7 +134,7 @@ async function importScrape(client, scrape) {p.tweetId, p.handle, p.authorHandle, p.url, p.text, p.postedAt,p.isRetweet, p.isReply, p.isPinned, p.hasImage, p.hasVideo, p.hasCard,p.hashtags, p.mentions, p.urls,- p.likes, p.retweets, p.replies, p.views, p.viewsLabel, p.viewsExact, p.measuredAt,+ p.likes, p.retweets, p.replies, p.views, p.viewsLabel, p.viewsExact, p.metricsSource, p.measuredAt,],);if (res.rowCount) {@@ -142,10 +143,10 @@ async function importScrape(client, scrape) {}await client.query(- `insert into x_account_post_snapshots (tweet_id, import_id, captured_at, likes, retweets, replies, views, views_label)- values ($1, $2, $3, $4, $5, $6, $7, $8)+ `insert into x_account_post_snapshots (tweet_id, import_id, captured_at, likes, retweets, replies, views, views_label, metrics_source)+ values ($1, $2, $3, $4, $5, $6, $7, $8, $9)on conflict (tweet_id, captured_at) do nothing`,- [p.tweetId, importId, p.measuredAt, p.likes, p.retweets, p.replies, p.views, p.viewsLabel],+ [p.tweetId, importId, p.measuredAt, p.likes, p.retweets, p.replies, p.views, p.viewsLabel, p.metricsSource],);}diff --git a/scripts/x-archive-lib.mjs b/scripts/x-archive-lib.mjsindex 3b83689af..017169efa 100644--- a/scripts/x-archive-lib.mjs+++ b/scripts/x-archive-lib.mjs@@ -38,6 +38,9 @@ export function parseCount(raw) {// named in the report; `npm run x:archive:refresh` replaces them with exact// counts from the X API.export function isMetricsSuspect(post) {+ // The X API returns public_metrics exactly, so a zero from it is a real+ // zero and must not be second-guessed by a heuristic built for the scraper.+ if (post.metricsSource === 'x-api-v2') return post.likes === null || post.likes === undefined;if (post.likes === null || post.likes === undefined) return true;if (post.likes > 0) return false;return (post.retweets || 0) > 0 || (post.replies || 0) >= 2 || (post.views || 0) >= 1000;@@ -59,7 +62,7 @@ export function authorOf(raw, fallbackHandle) {}// One scraped tweet -> the canonical row shape shared by the DB and the report.-export function normalizePost(raw, { handle }) {+export function normalizePost(raw, { handle, metricsSource = 'scrape' }) {const id = String(raw.id || '').trim();if (!id) throw new Error('tweet is missing an id');const posted = raw.timestamp ? new Date(raw.timestamp) : null;@@ -98,6 +101,7 @@ export function normalizePost(raw, { handle }) {views: views.value,viewsLabel: views.label,viewsExact: views.exact,+ metricsSource,measuredAt: raw.scrapedAt || null,};@@ -113,10 +117,14 @@ export function normalizeScrape(doc, { sourceText = null } = {}) {if (!scrapedAt || Number.isNaN(scrapedAt.getTime())) throw new Error('scrape file has no usable `scrapedAt`');if (!Array.isArray(doc.tweets)) throw new Error('scrape file has no `tweets` array');+ // A file written by scripts/x-archive-refresh.mjs declares its provenance;+ // anything else is a timeline scrape with the counter caveats that implies.+ const metricsSource = doc.source === 'x-api-v2' ? 'x-api-v2' : 'scrape';+const seen = new Set();const posts = [];for (const raw of doc.tweets) {- const post = normalizePost(raw, { handle });+ const post = normalizePost(raw, { handle, metricsSource });if (seen.has(post.tweetId)) continue; // a scrape can re-see a post while scrollingseen.add(post.tweetId);post.measuredAt = post.measuredAt || scrapedAt.toISOString();@@ -125,6 +133,7 @@ export function normalizeScrape(doc, { sourceText = null } = {}) {return {handle,+ metricsSource,scrapedAt: scrapedAt.toISOString(),posts,sha256: sourceText === null ? null : createHash('sha256').update(sourceText).digest('hex'),diff --git a/scripts/x-archive-refresh.mjs b/scripts/x-archive-refresh.mjsnew file mode 100644index 000000000..9a5ff4d79--- /dev/null+++ b/scripts/x-archive-refresh.mjs@@ -0,0 +1,174 @@+#!/usr/bin/env node+/**+ * Refresh archived X posts with exact metrics from the X API v2.+ *+ * The timeline scraper is the only way to recover posts we never recorded, but+ * its counters are what the page happened to render: like counts arrive late,+ * so a scroll-based scrape captures real posts at "0 likes", and every count+ * past 999 is abbreviated to two significant figures. GET /2/tweets returns+ * public_metrics exactly, for up to 100 ids per call, so one pass over the+ * archive replaces every rounded or missing number with a measured one.+ *+ * Usage:+ * node scripts/x-archive-refresh.mjs # every post in the archive+ * node scripts/x-archive-refresh.mjs --handle trythreews+ * node scripts/x-archive-refresh.mjs --suspect-only # only posts with unbelievable counters+ * node scripts/x-archive-refresh.mjs --limit 100 # cap the API spend on a first run+ *+ * Output: data/x-archive/<handle>-api-<YYYY-MM-DD>.json, in the same shape as a+ * scrape file, so `npm run x:archive:import` and `npm run x:archive:analyze`+ * read it with no special casing and the newer measurement wins.+ *+ * Requires X_API_BEARER (same credential scripts/refresh-tweet-metrics.mjs uses).+ */++import { readFileSync } from 'node:fs';+import { writeFile } from 'node:fs/promises';+import { fileURLToPath } from 'node:url';+import path from 'node:path';+import { ARCHIVE_DIR, isMetricsSuspect, listArchiveFiles, mergeScrapes, readScrapeFile } from './x-archive-lib.mjs';++const HERE = path.dirname(fileURLToPath(import.meta.url));+const REPO_ROOT = path.resolve(HERE, '..');++for (const envFile of ['.env.local', '.env']) {+ try {+ const raw = readFileSync(path.resolve(REPO_ROOT, envFile), 'utf8');+ for (const line of raw.split('\n')) {+ const m = line.match(/^([A-Z_][A-Z0-9_]*)=(.*)$/);+ if (!m || process.env[m[1]]) continue;+ let val = m[2].trim();+ if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) {+ val = val.slice(1, -1);+ }+ process.env[m[1]] = val;+ }+ } catch {+ // Absent env files are normal outside a configured checkout.+ }+}++const args = process.argv.slice(2);+const flag = (name) => args.includes(`--${name}`);+const value = (name) => {+ const i = args.indexOf(`--${name}`);+ return i >= 0 ? args[i + 1] : null;+};++const ONLY_HANDLE = value('handle');+const SUSPECT_ONLY = flag('suspect-only');+const LIMIT = Number(value('limit') || 0) || Infinity;++async function fetchBatch(ids, bearer) {+ const url = new URL('https://api.x.com/2/tweets');+ url.searchParams.set('ids', ids.join(','));+ url.searchParams.set('tweet.fields', 'public_metrics,created_at,text,entities,referenced_tweets');+ url.searchParams.set('expansions', 'author_id');+ url.searchParams.set('user.fields', 'username');++ const res = await fetch(url, { headers: { Authorization: `Bearer ${bearer}` } });+ if (res.status === 429) {+ const reset = Number(res.headers.get('x-rate-limit-reset') || 0) * 1000;+ const waitMs = Math.max(5_000, reset - Date.now() + 1_000);+ console.warn(`rate limited; waiting ${Math.round(waitMs / 1000)}s`);+ await new Promise((r) => setTimeout(r, waitMs));+ return fetchBatch(ids, bearer);+ }+ if (!res.ok) throw new Error(`X API ${res.status}: ${(await res.text()).slice(0, 400)}`);+ return res.json();+}++async function main() {+ const bearer = process.env.X_API_BEARER;+ if (!bearer) {+ console.error('X_API_BEARER is not set. Add it to .env / .env.local, or read it off the Cloud Run service.');+ process.exitCode = 3;+ return;+ }++ const files = await listArchiveFiles(path.resolve(REPO_ROOT, ARCHIVE_DIR));+ if (!files.length) throw new Error(`no scrape files in ${ARCHIVE_DIR}`);++ const byHandle = new Map();+ for (const file of files) {+ const scrape = await readScrapeFile(file);+ if (ONLY_HANDLE && scrape.handle !== ONLY_HANDLE.replace(/^@/, '')) continue;+ if (!byHandle.has(scrape.handle)) byHandle.set(scrape.handle, []);+ byHandle.get(scrape.handle).push(scrape);+ }++ for (const [handle, scrapes] of byHandle) {+ const { posts } = mergeScrapes(scrapes);+ const targets = posts+ .filter((p) => !SUSPECT_ONLY || isMetricsSuspect(p) || !p.viewsExact)+ .slice(0, LIMIT);+ if (!targets.length) {+ console.log(`@${handle}: nothing to refresh`);+ continue;+ }++ const byId = new Map(targets.map((p) => [p.tweetId, p]));+ const refreshed = [];+ const missing = [];+ const now = new Date().toISOString();++ for (let i = 0; i < targets.length; i += 100) {+ const batch = targets.slice(i, i + 100).map((p) => p.tweetId);+ const body = await fetchBatch(batch, bearer);+ const users = new Map((body.includes?.users || []).map((u) => [u.id, u.username]));+ for (const t of body.data || []) {+ const prior = byId.get(t.id);+ const m = t.public_metrics || {};+ refreshed.push({+ id: t.id,+ url: `https://x.com/${users.get(t.author_id) || prior?.authorHandle || handle}/status/${t.id}`,+ text: t.text ?? prior?.text ?? '',+ timestamp: t.created_at || prior?.postedAt,+ metrics: {+ likes: String(m.like_count ?? ''),+ retweets: String((m.retweet_count ?? 0) + (m.quote_count ?? 0)),+ replies: String(m.reply_count ?? ''),+ views: String(m.impression_count ?? ''),+ },+ media: {+ hasImage: prior?.hasImage || false,+ hasVideo: prior?.hasVideo || false,+ hasCard: prior?.hasCard || false,+ },+ type: {+ isRetweet: (t.referenced_tweets || []).some((r) => r.type === 'retweeted'),+ isReply: (t.referenced_tweets || []).some((r) => r.type === 'replied_to') || prior?.isReply || false,+ isPinned: prior?.isPinned || false,+ },+ extracted: {+ hashtags: (t.entities?.hashtags || []).map((h) => `#${h.tag}`),+ mentions: (t.entities?.mentions || []).map((u) => `@${u.username}`),+ urls: (t.entities?.urls || []).map((u) => u.expanded_url).filter(Boolean),+ },+ scrapedAt: now,+ });+ }+ for (const err of body.errors || []) if (err.resource_id) missing.push(err.resource_id);+ console.log(` batch ${i / 100 + 1}: ${body.data?.length || 0} refreshed, ${body.errors?.length || 0} unavailable`);+ }++ const out = {+ profile: handle,+ profileUrl: `https://x.com/${handle}`,+ scrapedAt: now,+ source: 'x-api-v2',+ totalTweets: refreshed.length,+ unavailable: missing,+ tweets: refreshed,+ };+ const outPath = path.resolve(REPO_ROOT, ARCHIVE_DIR, `${handle}-api-${now.slice(0, 10)}.json`);+ await writeFile(outPath, `${JSON.stringify(out, null, 2)}\n`);+ console.log(`@${handle}: ${refreshed.length} posts refreshed, ${missing.length} unavailable -> ${path.relative(REPO_ROOT, outPath)}`);+ console.log('Next: npm run x:archive:import && npm run x:archive:analyze');+ }+}++main().catch((err) => {+ console.error(err.message || err);+ process.exitCode = 1;+});