RSS Feed Readers Part I - FreshRSS

23 Nov 2017 . Category: Linux

I’ve recently been playing around with feedreaders, and how I get my data from the web. I was previously using Feedly, but then decided I didn’t want to share my data with them (linked to Facebook account). I then signed up for thefeedreader.com which is decent, but not exactly what I was after. So I thought I’d try out a couple of alternatives.

The first one I tried was FreshRSS which is a web based reader, though a self hosted solution. It was between this and TinyTinyRSS, but I decided to go with this one as it could be setup using a SQLIte Db rather than MySQL - I thought it would be easier for my Raspbery Pi to handle.

Setup

I previously had lighttpd installed on the Pi but after reading about it being buggy, I decided to remove and install nginx instead. I more or less followed this guide to install, though did hit upon an issue in that the PHP components were version 7.0 instead of 5 (just replaced 5 with 7.0 in the commands).

After setting up, the FreshRSS install didn’t go as planned as it stated I was missing libraries to process XML and DOM. This was especially annoying as it didn’t tell me what was missing. I was trying to instal libxml2 but that didn’t work and the PHP website wasn’t much use either. I randomly stumbled across a site that mentioned installing php7.0-xml and so I tried that - it worked!

I added some feeds and it looked like this:

FreshRSS

Hacking About

Everything was grand, almost. I didn’t like the way it was handelling my twitter feeds. They were truncated and I decided I wanted to click on a link and get taken to that users page - so I could read all the new tweets at once. I played around with writing a plug-in, though later found out it didn’t work as the links in the feed were potentially another users (if it was a Re-Tweet). In case it’s of any use, this is sort of what I had:

class TwitterLinksExtension extends Minz_Extension {
	public function init() {
		//$this->registerHook('entry_before_insert', array($this, 'transformLink'));

		// Use this one for debug.  Doesn't store in Db
		$this->registerHook('entry_before_display', array($this, 'transformLink'));
	}

	public function transformLink($entry) {
		// $entry is FreshRSS_Entry objecy
		// Accessible fields:
		// title, author, content, link, date, is_read, is_favourite, feed

		$link = $entry->link();

		// Only apply this stuff two twitter feed items
		 if (false === strpos($link, 'twitter.com')) {
			return $entry;
		}

		// Store the content
		$content = $entry->content();

		// Get the link the the users page
		// Note author contains re-tweeters name, not the user I'm following
		// Don't work for retweets as has retweeter.
		$pos = strpos($link,'/', 20);
		$timelineLink = substr($link, 0, $pos);
		$entry->_content(sprintf('%s <p>Link %s</p>', $content, $entry->feed()));
		return $entry;
	}
}

Plan B involved hacking around the helper files (app/views/helpers/index/normal/entry_header.phtml) to change the links with a bit of php. Not very nice really, but got the job done - I’m sure there’s an alternative that’s better, but difficult with to lack of documentation etc.

Overall, the program seemed good and I liked the clean look. There were a few negatives though, so I’ll be back with a part II. To summarise my thoughts on this feed reader:

Pros

  • Nice clean interface
  • Not depending on 3rd parties.
  • Can modify it, but not super easy (See code above)

Cons

  • Not much documentation. Code is well commented but IN FRENCH. Harder for me to hack about with.
  • I’m not familiar with MVC / PHP anymore. Mixture of html/PHP looks like a dogs dinner.
  • Do I want to keep my Raspberry Pi turned on all the time?? Thought about Rsyncing the Db with my linux machine as could then hand off Db.
  • Not all links work well with vimprenator (or Tridactyl, it’s replacement). This is a big -ve.

Me

Iain Benson is a real person and not a grassy plant viking. He lives in Scotland. In his spare time, Iain likes tinkering with his Raspberry Pi, going for long walks and drinking wine. Preferably all at the same time.