Skip to content

fix: resolve author from new X user schema (core) in export scripts#84

Open
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/bookmarklet-author-schema
Open

fix: resolve author from new X user schema (core) in export scripts#84
JinZhongcun wants to merge 1 commit into
viperrcrypto:mainfrom
JinZhongcun:fix/bookmarklet-author-schema

Conversation

@JinZhongcun

@JinZhongcun JinZhongcun commented Jul 14, 2026

Copy link
Copy Markdown

Summary

X moved user fields (name, screen_name) from user_results.result.legacy to user_results.result.core. Both the bookmarklet and the console export script only read .legacy, so on the current schema every exported tweet comes back with author: "Unknown" / handle: "@unknown".

Changes

  • Read the user from .legacy first and fall back to .core (both BOOKMARKLET_SCRIPT and CONSOLE_SCRIPT in app/import/page.tsx)
  • Resolve the avatar from user_results.result.avatar.image_url when profile_image_url_https is absent

Related Issues

None

Checklist

  • Tested locally — verified against a live export of ~10,000 bookmark timeline items: authors resolved for 100% of captured tweets (6,318) on the current schema
  • npx tsc --noEmit — no new errors introduced by this change (the 2 pre-existing errors in app/api/import/x-oauth/fetch/route.ts are present on main as well)
  • No new warnings

X moved user fields (name, screen_name) from user_results.result.legacy
to user_results.result.core, so both the bookmarklet and the console
export script now return author: "Unknown" and handle: "@unknown" for
every captured tweet.

Read .legacy first and fall back to .core, and resolve the avatar from
user_results.result.avatar.image_url when profile_image_url_https is
absent. Verified against a live export of ~8,000 bookmarks: authors
resolve correctly on the current schema, and exports from the old
schema keep working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant