TradingA trading & investing wiki

jfsrev Substack ingest workflow

Kindjfsrev

jfsrev Substack ingest workflow

This folder houses the wiki-book reading of jfsrev's long-form Substack archive (separate from his X/Twitter "Plan & Focus Stocks" tweets, which land in 30 - Watchlists/). Pipeline mirrors the sibling 10 - Norseman/ section.

Generic plumbing (fetch → drain → markdown) lives under .scripts/: substack_fetch.py, substack_to_md.py. jfsrev-specific clustering uses _jfsrev_* siblings of the Norseman cluster scripts.

Folder layout

Folder / fileContents
_raw/One file per Substack post: YYYY-MM-DD - <slug>.md. Verbatim body + frontmatter (date, title, subtitle, url, slug, source, type, audience, paywalled, cover, concepts, tickers, themes, chapter).
_raw/_attachments/<slug>/Inline images downloaded during the scrape.
Chapters/Themed chapters that tie related posts together with prose + transclusions. Filename NN - <Theme>.md.
Concepts/jfsrev-specific terminology (VARS, 3-Stop Strategy, T+3, etc.). General concepts live under 40 - Concepts/.
jfsrev MOC.mdReading entry point.
jfsrev Timeline.mdChronological view of every post.

Step 1 — Archive scrape

The jfsrev archive endpoint at https://jfsrev.substack.com/api/v1/posts/?limit=50&offset=N is reachable anonymously. The per-post body_html endpoint /api/v1/posts/by-id/<id> returns the full body for free posts and a public teaser for only_paid posts. To pull full paywalled bodies (5 of the 6 paid posts return only a short teaser), send a fresh Substack session cookie:

# 1. Optional — drop a Cookie: header value in this file (the substack.sid
#    cookie is enough). Skip this if you only need free + teaser bodies.
echo "substack.sid=...; another=..." > .scripts/_jfsrev_cookie.txt

# 2. Enumerate + fetch
.scripts/_venv/bin/python .scripts/substack_fetch.py \
  --pub jfsrev --name jfsrev \
  --cookie-file .scripts/_jfsrev_cookie.txt   # optional

Caches the index to .scripts/_jfsrev_index.json and writes each post's rendered HTML envelope to .scripts/_jfsrev_html/<slug>.html. Resumable — re-running skips any slug whose HTML cache file already exists.

Step 2 — Convert to vault markdown

.scripts/_venv/bin/python .scripts/substack_to_md.py \
  --name jfsrev \
  --out "11 - jfsrev" \
  --source-link "[jfsrev](/trading/notes/sources/jfsrev)" \
  --type jfsrev-post \
  --tag jfsrev

Writes _raw/<YYYY-MM-DD> - <slug>.md for every cached HTML, downloads inline images into _raw/_attachments/<slug>/, truncates filenames longer than 200 chars (jfsrev slugs sometimes hit the macOS 255-byte limit), and preserves any chapter:/concepts:/tickers:/themes: frontmatter you've backfilled when invoked with --overwrite.

Paywalled posts whose body came back as a short teaser get a > [!warning] Paywalled — only the public teaser is captured below. banner above the body.

Step 3 — Survey, classify, write chapters

.scripts/_venv/bin/python .scripts/survey_substack.py --root "11 - jfsrev/_raw"
.scripts/_venv/bin/python .scripts/extract_tickers.py --root "11 - jfsrev/_raw" > .scripts/_jfsrev_tickers.md

# jfsrev-specific
.scripts/_venv/bin/python .scripts/_jfsrev_assign_chapters.py
.scripts/_venv/bin/python .scripts/_jfsrev_write_chapters.py
.scripts/_venv/bin/python .scripts/_jfsrev_backfill_chapters.py
.scripts/_venv/bin/python .scripts/_jfsrev_write_concepts.py
.scripts/_venv/bin/python .scripts/_jfsrev_seed_tickers.py

The chapter taxonomy (~60 posts total) is:

  1. Methodology — Process, Tools & Routine (4 posts incl. the 2025 flagship)
  2. Mindset & Trader Philosophy (3 short essays)
  3. Performance Retrospectives (2 USIC guest posts)
  4. The Weekly Picture (Dec 2021 → Mar 2022) (15 posts, original-format)
  5. 10 Minutes Weekly Picture (Mar → Nov 2022) (35 posts, rebranded)
  6. Curated Market Diary & Playbook (3 named-ticker editions)

Step 4 — Time-based browsing

  • File explorer: filenames are date-prefixed, so they sort chronologically.
  • Calendar plugin (right sidebar): dots on every day with a jfsrev post.
  • jfsrev Timeline.md: full chronological table + per-month groups.

Step 5 — Re-syncing later

  1. Re-run substack_fetch.py --pub jfsrev (skips already-cached posts).
  2. Re-run substack_to_md.py (skips existing md unless --overwrite).
  3. Re-run _jfsrev_assign_chapters.py and _jfsrev_write_chapters.py so new posts land in their chapter and per-chapter date ranges update.
  4. New jfsrev-specific concepts → 11 - jfsrev/Concepts/<Term>.md. General concepts → 40 - Concepts/<Term>.md.