Tweet ingest from Dewey CSV

Screenshot of the Dewey app's Unsorted view — a grid of bookmarked X posts as cards, each with author, date, and content.
The Dewey app's Unsorted view — bookmarks as cards, captured but not yet processed. Source for the CSV that this script ingests. Screenshot from dewey.tips.

The vault holds ~4,700 bookmarked tweets, each as a single markdown file with rich YAML frontmatter (author, handle, date, source URL, category, namespaced tags). Dewey exports come as CSVs that look nothing like the vault’s format. The script bridges the two.

What it does

  1. Reads a Dewey CSV from ~/Downloads/
  2. Builds a set of tweet IDs already present in the vault by scanning each note’s source: field for status/(\d+)
  3. For every CSV row not already in the vault, generates a markdown file matching the vault schema:
    • Filename YYYY-MM-DD-handle-slug.md
    • YAML frontmatter (author, handle, date, time, year, source, type, platform, category, topics, tags)
    • Body with attribution header, content, source link, and optional media URL
  4. Writes only — never modifies existing entries

Notes

  • Category is assigned by keyword matching against the vault’s existing taxonomy
  • Topic tags use the vault’s namespaced convention (topic/X)
  • One run on a 46k-line CSV completes in seconds; the bottleneck is reading vault markdown for ID extraction