====== Syncing status.lol to twtxt ====== Automatically publish [[protocols:smallweb:twtxt|twtxt]] entries from [[https://status.lol/brennan|status.lol]] updates at build time, via the [[https://api.omg.lol/|omg.lol API]]. ===== The Flow ===== - Post once on status.lol - Eleventy fetches the omg.lol API at build time (cached 1 hour) - Transforms JSON statuses → twtxt format (ISO 8601 timestamp + content) - Generates ''/twtxt.txt'' as a static file on the site Result: the update appears simultaneously on status.lol, social.lol (Mastodon), and the twtxt feed. No cross-posting required. ===== Eleventy Data Fetch ===== In ''.eleventy.js'', register a global data source: eleventyConfig.addGlobalData("statuslog", async () => { let json = await EleventyFetch( "https://api.omg.lol/address/brennan/statuses/", { duration: "1h", type: "json" } ); return json.response.statuses.map(status => ({ timestamp: new Date(parseInt(status.created) * 1000) .toISOString().replace(/\.\d{3}Z$/, '-07:00'), content: `${status.emoji || ''} ${status.content}`.trim(), created: status.created })).sort((a, b) => b.created - a.created); }); * ''EleventyFetch'' handles caching (1 hour) to keep API calls minimal * Unix timestamps (seconds) → ISO 8601 with MST offset (''-07:00'') * Emoji and content joined into a single message string ===== twtxt.txt Template ===== A Nunjucks template in the Eleventy project with ''permalink: /twtxt.txt'': --- permalink: /twtxt.txt eleventyExcludeFromCollections: true --- # nick = brennan # url = https://brennan.day/twtxt.txt # avatar = https://brennan.day/assets/images/brennan.jpg # description = Queer Métis author and FOSS web developer from Treaty 7 territory {%- for status in statuslog %} {{ status.timestamp }} {{ status.content }} {%- endfor %} **Important:** The separator between ''{{ status.timestamp }}'' and ''{{ status.content }}'' must be a literal TAB character, not spaces. ===== Output ===== 2026-01-21T10:30:00-07:00 🚧 Testing twtxt setup 2026-01-20T09:15:00-07:00 ☕ Morning coffee and code ===== Why ===== Status updates live on your own domain, in a format readable by any HTTP client. People can follow from Mastodon, twtxt clients, or a plain browser. The content is not trapped in a single ecosystem. ===== See Also ===== * [[indieweb:start|IndieWeb Index]] * [[protocols:smallweb:twtxt|twtxt protocol]] * [[indieweb:principles|IndieWeb Principles — POSSE]] * [[start|Return to wiki home]]