thiagowfx's avatar

ยฌ just serendipity ๐Ÿ€ (not just serendipity)

โ˜… miniflux: add country flags to all feeds ๐ŸŒ

โ€ข 660 words โ€ข 4 min

Problem statement: given my miniflux server with hundreds of RSS feed subscriptions, add emoji country flags to each feed title, representing their country of origin and/or the country they’re associated with1.

For example:

  • Before: Not Just Serendipity by Thiago Perrotta
  • After: Not Just Serendipity by Thiago Perrotta ๐Ÿ‡ง๐Ÿ‡ท๐Ÿ‡จ๐Ÿ‡ฆ

Some feeds may be identified with multiple flags. The distinction is purposely loose.

I started to do this tagging process manually, throughout several weeks, until I exhausted the ones I knew about.

The next natural step, in 2026, is to resort to Gen AI to finish the heavy lifting, now that the initial pattern has been established.

With my OpenAI Codex subscription and pi, I prompted away:

User: List all prompts I ran in this session, bulleted list:

Thinking: Listing all user prompt messages

  • “Are you able to connect to my miniflux database in knol? (ssh knol) Creds are in /etc/miniflux.conf in knol.”
  • “Note that Alpine Linux uses doas, not sudo.”
  • “Are you able to find my list of subscriptions / feeds? There should be 687 of these.”
  • “Observe that some feed titles have flags in them.”
  • “I want to add a flag for the origin of each blog. Source a few feeds lacking flags and suggest which flags to add.”
  • “LGTM.”
  • “Source 10โ€“15 more blogs.”
  • “LGTM.”
  • “Write a blog post about this work using /bloggify.”
  • “List all prompts I ran in this session, bulleted list.”

Here are a few interesting bits produced by the agent. Note that I run the coding harness (pi) from my laptop, not from my server. As such, all commands that interact with the server do so via ssh. This is good enough for my purposes.

Count all feeds:

shell
% ssh knol 'doas sh -c '\''. /etc/miniflux.conf; psql "$DATABASE_URL" -X -Atqc "SELECT count(*) FROM feeds"'\'''
687

Some titles already followed the convention:

text
780|37signals jobs ๐Ÿ‡ฉ๐Ÿ‡ฐ๐Ÿ‡บ๐Ÿ‡ธ
818|A cup of coffee by Quentin JOLY ๐Ÿ‡ซ๐Ÿ‡ท
1366|AI Engineer Guide ๐Ÿ‡ฎ๐Ÿ‡ณ
562|Adam Gordon Bell: Cascade Of Insights ๐Ÿ‡จ๐Ÿ‡ฆ
916|Adam Johnson ๐Ÿ‡ฌ๐Ÿ‡ง

A pair of Unicode regional indicators forms a flag. Export the titles and count those pairs:

shell
% ssh knol 'doas sh -c '\''. /etc/miniflux.conf; psql "$DATABASE_URL" -X -q -c \
  "COPY (SELECT id, title FROM feeds ORDER BY title) TO STDOUT WITH CSV"'\''' | \
  python3 -c 'import csv,sys,re; rows=list(csv.reader(sys.stdin)); p=re.compile(r"[\U0001F1E6-\U0001F1FF]{2}"); found=[(i,t,p.findall(t)) for i,t in rows if p.search(t)]; print(f"feeds_with_flags={len(found)} flags={sum(len(x[2]) for x in found)}")'
feeds_with_flags=148 flags=158

I did not infer origin from a name, domain, language, or current residence. Each addition needed an explicit source. For example, Jeremy Keith says “I’m from Ireland originally”, Andre Garzia says he is originally from Brazil, and Christian Rebischke describes himself as being from Germany.

The title itself is the metadata. Exact old-title guards made each update idempotent and prevented an accidental edit to a renamed feed:

sql
BEGIN;
UPDATE feeds
SET title = 'Christian Rebischke: shibumi ๐Ÿ‡ฉ๐Ÿ‡ช'
WHERE id = 207 AND title = 'Christian Rebischke: shibumi';
UPDATE feeds
SET title = 'Adactio: Journal by Jeremy Keith ๐Ÿ‡ฎ๐Ÿ‡ช'
WHERE id = 1106 AND title = 'Adactio: Journal by Jeremy Keith';
UPDATE feeds
SET title = 'Adactio: Articles by Jeremy Keith ๐Ÿ‡ฎ๐Ÿ‡ช'
WHERE id = 1107 AND title = 'Adactio: Articles by Jeremy Keith';
UPDATE feeds
SET title = 'Andre Alves Garzia ๐Ÿ‡ง๐Ÿ‡ท'
WHERE id = 1481 AND title = 'Andre Alves Garzia';
COMMIT;
text
BEGIN
UPDATE 1
UPDATE 1
UPDATE 1
UPDATE 1
COMMIT

A second sourced batch added 12 more titles. Compound origins stay compound:

text
430|Burak Karakan: ps ๐Ÿ‡ฉ๐Ÿ‡ช๐Ÿ‡น๐Ÿ‡ท
1022|Amjad Masad ๐Ÿ‡ฏ๐Ÿ‡ด๐Ÿ‡บ๐Ÿ‡ธ
1076|Christopher Olah ๐Ÿ‡จ๐Ÿ‡ฆ
1100|Cognitive Medium by Michael Nielsen ๐Ÿ‡ฆ๐Ÿ‡บ๐Ÿ‡บ๐Ÿ‡ธ
1174|Andrej Karpathy ๐Ÿ‡ธ๐Ÿ‡ฐ๐Ÿ‡จ๐Ÿ‡ฆ
1489|Jeff Geerling ๐Ÿ‡บ๐Ÿ‡ธ

The same audit now reports:

text
total=687
feeds_with_flags=164
flags=178
without_flags=523

Only 523 to go.

This is a practical excuse to tokenmaxx, eh?!

Web searches are done with pi-web-search. โˆŽ


  1. Why? Purely as a matter of context, and for an extra dose of serendipity via diversity. For example, it’s often exciting to me to read posts from other Canadians, for no particular reason. ↩︎