Published November 15, 2015
Twitter is a really cool social network. I daily use it and I discover a lot of new stuff with it. Unfortunately, it's a company, and they need to earn some money. More and more often, Twitter shows me unwanted content like tweets you could like, accounts to follow or what happens when you're away.
I don't want all these features, I just want the tweets of people I follow in chronological order. What I want is an RSS feed.
Add an RSS feed in Hakyll
It's a really simple operation, everything is explained here. In the tutorial, they explain how to render either an Atom or an RSS feed. I decided to provide both. To do that, I've created a small function named
RenderingFunction is the signature provided by Hakyll for
type RenderingFunction = FeedConfiguration -> Context String -> [Item String] -> Compiler (Item String)
Then, my function is just a copy paste from the function in the tutorial.
= create [name] $ do route idRoute compile $ do posts <- fmap (take 10) . recentFirst =<< loadAllSnapshots "posts/*" "content" renderingFunction myFeedConfiguration feedCtx posts createFeed name renderingFunction
Eventually, I just need to call my new function for
"feed.xml" renderRss createFeed "atom.xml" renderAtom createFeed
The HTML part
To make my feeds work with most of the aggregators, I need to add two
links to my default template.
I personally use FreshRSS. It's a simple, self-hostable aggregator under the AGPL license. The installation is really simple and there is a lot of useful features (like keyboard shortcuts and integration with Wallabag)