Building this Website (8. feed)

Thursday, April 30, 2020

This is a series of posts which technically describes how Not Even Odd is built.

This post describes how this site's web feed is generated.


Web feeds

There's no need to rely on "social media" apps/sites and their magic algorithms that "know what you want to see". Those sites have many issues (including privacy) and may end you showing up what's in their interest, not yours. It is wiser to take charge of what content you want to follow. Simple web feeds (which you might keep track of with a news reader) are a great way to stay up-to-date on whatever you decide. They are especially useful for low volume or infrequently updated sites (such as this one).

P

I'd like to provide a webfeed feed to this site. Hints to do this with TiddlyWiki would be:

  • There's a feature request ticket open to add feed generation to TiddlyWiki, but it has been open for years.
  • There's an Atom feed plugin available for TiddlyWiki, but I have not tried it (and I prefer not to use external plugins)

An alternative option would be to generate the feed by myself (script, etc.). This is yet something I aim to do.

is a two stpes approach:

  1. while we generate the static pages, we create
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>Not Even Odd</title>
      <description>Not Even Odd</description>
      <link>http://notevenodd.net</link>
      <atom:link href="http://notevenodd.net/feed.xml" rel="self" type="application/rss+xml" />

      <item>
         <title>...</title>
         <link>http://notevenodd.net/...</link>
         <guid>http://notevenodd.net/...</guid>
         <pubDate>...</pubDate>
      </item>
      ...

   </channel>
</rss>

Building own Feed

1. using TiddlyWiki internals to get the right fields

We use a TiddlyWiki list to go over the 10 last post and write down TITLE, LINK, and PUBDATE. We ask and use to build the file, the feed.xml_helper tiddler:

my feed.xml_helper. tiddler:
<pre><$list filter="[!tag[private]!tag[draft]!has[draft.of]!is[system]!has[notpost]sort[created]last[10]reverse[]]">TITLE:{{!!title}}
FILE:<$link to={{!!title}} />
DATE:<$view field="created"/>
</$list></pre>

2. use that information with a tiny shell script


previous: external files
next: hosting with github

Not Even Odd

Musings and mumblings of a random nerd

Last 10 Posts:

Building this Website (8. feed)
Free Software
Building this Website (7. plugins)
Building this Website (6. external files)
Building this Website (5. tiddlers' date)
Building this Website (4. tags)
Building this Website (3. navigation)
Building this Website (2. template)
Building this Website (1. content selection)
Building this Website

...

Tags
see all tags
    All Posts
    (alphabetically | chronologically)

Follow:        ...