Recipes
You finish this chapter with five small jobs done or ready to run, each assembled from calls the lab verified. Where a recipe includes a step the lab did not run, the recipe says so at that step — the rest of it stands on transcripts.
1. Take your whole list with you (OPML out)
Your subscription list — every feed, sorted into its categories — is one call (verified, transcript t08):
curl -s -H 'X-Auth-Token: YOUR-KEY' \
http://127.0.0.1:8080/v1/export > my-feeds.opml
The lab's answer began:
<opml version="2.0" xmlns:miniflux="https://miniflux.app/opml">
and carried both of its feeds, each
nested in its category. Every serious
reader imports this format, so this
file is your exit door and your backup
in one: keep a copy with the database
backups. Bringing a list in — the
Feeds → Import page, or
POST /v1/import — is the mirror
operation; the lab exported only, and
imports are the documented half of
this recipe.
2. How much is waiting? (a one-line count)
The check chapter 8 kept running, dressed as a script:
curl -s -H 'X-Auth-Token: YOUR-KEY' \
'http://127.0.0.1:8080/v1/entries?status=unread&limit=1' \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["total"])'
The total in Miniflux's answers
counts everything matching, not just
the page returned, so limit=1 keeps
the answer small while the count stays
honest. This is the shape of every
sane monitoring or morning-summary
script: ask the count, not the pile.
3. Add a pocketful of feeds at once
Subscribing is one call per feed (chapter 5), so a list of addresses is a loop:
while read -r url; do
curl -s -X POST http://127.0.0.1:8080/v1/feeds \
-H 'X-Auth-Token: YOUR-KEY' \
-H 'Content-Type: application/json' \
-d "{\"feed_url\": \"$url\"}"
echo " <- $url"
done < feed-addresses.txt
Each answer is a feed_id or an
error_message worth reading — a dead
address says so here, once, instead of
failing silently on the schedule. Feed
each new arrival into a category
afterwards with chapter 7's move, or
subscribe with "category_id" named
in the same call — that field sits in
the feed record the lab printed, and
is the documented shortcut of this
recipe.
4. A morning digest in your terminal
The entries call with a direction and a limit is a digest waiting for a printer (all parts verified in transcripts t04 and t05):
curl -s -H 'X-Auth-Token: YOUR-KEY' \
'http://127.0.0.1:8080/v1/entries?status=unread&order=published_at&direction=desc&limit=10' \
| python3 -c '
import json, sys
d = json.load(sys.stdin)
for e in d["entries"]:
print("-", e["title"], "(", e["feed"]["title"], ")")'
Run it from cron at breakfast time and it prints the ten newest things you have not read. Marking them read is not in the recipe — a digest you glanced at over coffee is not the same as reading, and chapter 6's bookkeeping should stay honest.
5. Save the good ones sideways
Entries you star stay in Miniflux (chapter 6). To keep them in a place built for keeping — a bookmark shelf like Linkding, covered by its own guide in this series — the settings under Settings → Integrations let Miniflux send starred or saved entries outward to a shelf of such services, and webhooks besides. This recipe is the documented one of the chapter: the lab ran no integration, so treat the first send as a test — star something unimportant, watch the other end, and only then wire it into habit.