Tag Archives: feeds

Running tinytinyRSS on Cloud Foundry

Google Reader is going away in a week or so, and my friends have been asking me where I’m migrating all of my feed reading activities to. The answer for me is a combination of Flipboard and Feedly (both of which I recommend), but for those who prefer a more traditional Reader-style UI and also to retain ownership of their data, running tinytinyRSS is a possible alternative. I’d heard about it, but was tipped off to it again by my friend Dave Neary over at Red Hat 🙂

tinytinyRSS is a PHP application and needs a MySQL or PostgreSQL database. It offers the ability to import an OPML file (basically an XML format for listing RSS subscriptions), as well as various other capabilities and plugins.

Since we launched Cloud Foundry Hosted Developer Edition (aka CF v2) last week, I thought I’d find out how much effort it would be to install and run ttRSS on our new platform. It should “just work” – with buildpack support, you can now bring your own runtime to the platform… and we currently have free Marketplace SQL offerings from ElephantSQL and clearDB. Checks all the boxes!

Here’s what happened when I set up ttRSS on run.pivotal.io (the new URL where Cloud Foundry Hosted Developer Edition from Pivotal runs, replacing the old cloudfoundry.com beta hosted service).

First, I read the installation guide and downloaded the latest release tarball (linked at the bottom of the main wiki page). Then I unpacked the tarball on my Mac.

Once inside the release directory, I decided to just “push” the app to Cloud Foundry. I knew I’d need a PHP runtime, so my first thought was to point at the Heroku PHP buildpack (CF v2 is compatible with many Heroku buildpacks). I grabbed the URL and entered the following:

Tiny-Tiny-RSS-1.8  cf push --buildpack=https://github.com/heroku/heroku-buildpack-php
Name> tinytiny

Instances> 1

1: 64M
2: 128M
3: 256M
Memory Limit> 256M

Creating tinytiny... OK

1: tinytiny
2: none
Subdomain> tinytiny

1: cfapps.io
2: mqttbridge.com
3: none
Domain> 1

Creating route tinytiny.cfapps.io... OK
Binding tinytiny.cfapps.io to tinytiny... OK

Create services for application?> y

1: blazemeter n/a, via blazemeter
2: cleardb n/a, via cleardb
3: cloudamqp n/a, via cloudamqp
4: elephantsql n/a, via elephantsql
5: mongolab n/a, via mongolab
6: rediscloud n/a, via garantiadata
7: treasuredata n/a, via treasuredata
What kind?> 4

Name?> elephantsql-53b67

1: turtle: Tiny Turtle
Which plan?> 1

Creating service elephantsql-53b67... OK
Binding elephantsql-53b67 to tinytiny... OK
Create another service?> n

Bind other services to application?> n

Save configuration?> y

Saving to manifest.yml... OK
Uploading tinytiny... OK
Starting tinytiny... OK
-----> Downloaded app package (3.1M)
Initialized empty Git repository in /tmp/buildpacks/heroku-buildpack-php/.git/
Installing heroku-buildpack-php.
-----> Bundling Apache version 2.2.22
-----> Bundling PHP version 5.3.10
-----> Uploading staged droplet (12M)
-----> Uploaded droplet
Checking tinytiny...
Staging in progress...
Staging in progress...
  0/1 instances: 1 starting
  1/1 instances: 1 running
OK

Hurrah! The app is deployed! Note that while I was running through the steps here, I also chose to provision an ElephantSQL instance and bind it to my app. I could also have done that via the Marketplace in the Web Console before pushing the app. The tinytinyRSS wiki suggested that it performs better with Postgres than it does with MySQL, so I chose to use that.

The next step in the regular installation is to visit the URL (in this case http://tinytiny.cfapps.io) and check that things are working OK. When I got there, I found a form asking me to fill in the database credentials.

That’s a small issue – right now, there is no autoconfiguration for PHP apps with databases on Cloud Foundry, and I hadn’t modified the application code to grab the information from anywhere in the environment. Fortunately, there is a way to find out what the settings should be – via the env.log file in the application container. Running cf logs got me back the contents of the file. VCAP_SERVICES is where I needed to look.

VCAP_SERVICES={"elephantsql-n/a":[{"name":"elephantsql-53b67","label":"elephantsql-n/a","plan":"turtle","credentials":{"uri":"postgres://xxxxkjkj:lbI7r3Bh@babar.elephantsql.com:5432/xxxxkjkj"}}]}

I’ve modified the values here, for obvious reasons, but I plugged the values from the elephantsql service right into the form… hit the Test DB button… and got an error that my PHP runtime didn’t have support for mbstring…

Hmm!

Fortunately, there’s another buildpack for Heroku which adds PHP support, and does have support for mbstring (as well as using nginx instead of Apache, and a few other tweaks). I thought I’d give that one a go instead. I’d already saved my application settings to the manifest.yml file, so I could not just push a second time with a different buildpack, I had to use the --reset flag to apply the change:

Tiny-Tiny-RSS-1.8  cf push --buildpack=https://github.com/iphoting/heroku-buildpack-php-tyler.git --reset
Using manifest file manifest.yml

Uploading tinytiny... OK
Changes:
  buildpack: 'https://github.com/heroku/heroku-buildpack-php' -> 'https://github.com/iphoting/heroku-buildpack-php-tyler.git'
Updating tinytiny... OK
Stopping tinytiny... OKStarting tinytiny... OK
-----> Downloaded app package (3.1M)
-----> Downloaded app buildpack cache (4.0K)
Initialized empty Git repository in /tmp/buildpacks/heroku-buildpack-php-tyler.git/.git/
Installing heroku-buildpack-php-tyler.git.
-----> Fetching Manifest
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/manifest.md5sum
-----> Installing Nginx
       Bundling Nginx v1.4.1
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/nginx-1.4.1-heroku.tar.gz
-----> Installing libmcrypt
       Bundling libmcrypt v2.5.8
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/libmcrypt-2.5.8.tar.gz
-----> Installing libmemcached
       Bundling libmemcached v1.0.7
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/libmemcached-1.0.7.tar.gz
-----> Installing PHP
       Bundling PHP v5.4.12
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/php-5.4.12-with-fpm-heroku.tar.gz
-----> Installing newrelic
       Bundling newrelic daemon v2.9.5.78
       https://s3.amazonaws.com/heroku-buildpack-php-tyler/newrelic-2.9.5.78-heroku.tar.gz
-----> Copying config files
-----> Installing boot script
-----> Done with compile
-----> Uploading staged droplet (38M)
-----> Uploaded droplet
Checking tinytiny...
Staging in progress...
Staging in progress...
Staging in progress...
  0/1 instances: 1 starting
  0/1 instances: 1 starting
  0/1 instances: 1 starting
  1/1 instances: 1 running
OK

Success again! reloading the configuration page, I was greeted with confirmation that the database connection was now working.

Screenshot_21_06_2013_14_58-4

After this, I simply needed to initialise the database, save the configuration, login, change my password, and import my Google Reader OPML file (there are ttRSS plugins which also allow you to import your whole Google Takeout from Reader, including likes and shares).

Screenshot_21_06_2013_15_16-2

As I said, I’m personally a big fan of Feedly and I don’t think I’ll be using ttRSS full-time, but this was a really nice and very quick way to prove that Cloud Foundry v2 is ready to host these kind of apps – even with the redeployment step to swap buildpacks. You might want to give it a try!

 

All about RSS

This is a short post to accompany my appearance on The Dan Logan Show on Focal Radio this evening. Hello, Dan Logan Show listeners! If you’re wondering who on earth I am, take a look at my About page! 🙂

RSS – the basics

RSS stands for Really Simple Syndication, and basically it’s a way of publishing information online. Once upon a time, you would have to open a bunch of web pages to keep up with the news and see what had been updated. These days, you can subscribe to the feeds that those pages provide, and the updates will automagically appear in your feed reader.

RSS and another similar technology called Atom are often grouped together and called “feeds”. If you’re into the visuals, then you’ll enjoy a short 3 minute video called RSS in Plain English which shows what this is all about. If you want the technical description, then take a look at Wikipedia which goes into way more detail!

The RSS or feed icon is usually a little orange square with 3 radar-like stripes, but you’ll also find it shown as a blue or orange box which says ‘XML’ or ‘RSS’ in it. Here’s an example of the standard icon shown at the bottom of my Flickr page:

FlickrRSS.png

[confusingly – on Dan’s blog, there’s no icon, but right at the bottom of the page is a link that says Subscribe to: Posts (Atom) – that’s basically the same thing, just without a nice orange icon]

What’s a feed reader?

A feed reader is a program or application you can use to subscribe to and read different feeds. They usually look a bit like an email program like Outlook or Thunderbird, with feeds on the left and items on the right. There’s an online feed reader called Google Reader which is easy to get started with, or you could use any one of a large range of feed readers for Windows, Mac or Linux.

Which sites use RSS?

Lots and lots of sites use feeds now – it is becoming a really common way of providing updating information. Flickr, Twitter, BBC News, and others all provide feeds. Facebook is a little more tricky because their feeds are quite well hidden, but one thing you can do with Facebook is point it at a feed you publish, and it can then import the information as Notes – there’s an article that talks about how to set that up. There are literally thousands of sites that provide feeds – one “directory” of them is Syndica8.

If you’re looking for events in your area then you could take a look at Upcoming which provides feeds based on your searches. For gigs there’s also the-mag (which seems to mostly list gigs in the south, but you could always publish your own on there).

What else can I do with feeds?

The first thing to realise is that you don’t need to be really into technology to use feeds. If you write a blog, publish photos on Flickr, or publish a podcast, then feeds are already being created for you, and you don’t have to do anything at all!

However, if you’re into coding, you can mash them up. You could use something like Yahoo Pipes to visually wire them together and combine the output. Things like this cool interactive map of BBC News stories are mashups of RSS feeds with Google Maps, for instance. It’s a bit techie but also quite straightforward when you learn how. You can see a whole load of different mashups that other people have built at ProgrammableWeb.

Audio clips

Andy talks to Dan and Dayve about RSS (download)

Dan and Dayve talk Geocaching (download)

Thanks to Dan and Dayve for inviting me onto the show – it was a blast! They are doing some great stuff around social networks, geocaching, Twitter, blogging etc – it’s a fun programme. Looking forward to following them in their new Sunday slot.

Aggregation using MoonMoon

One of my current side projects / tinkerings is the creation of a site which aggregates a bunch of my online feeds – an aggregated “identity dashboard”.

Jean-Francois made me think about using WordPress to do this. I love WordPress. It’s so ridiculously simple to install… provided you have a PHP + MySQL host, you just unzip, provide the DB login information in the config file, and then it initialises itself and has a nice administration dashboard. I played around with adding some feeds in widgets on the sidebar, and it kind of works. I can edit my own pages and I don’t have to use it as a blog.

Talking to Rob on Friday led me to experiment with Planet. Planet is built in Python, and generates static HTML pages. It is exclusively built for aggregating feeds together, and it works fine, but I have to go hack around in config files, setup a cron job, and so on.

Something I’d never heard about until today is MoonMoon. This is a PHP-based web solution (like WordPress) but it’s a simple feed aggregator rather than a CMS (i.e. similar to Planet). It doesn’t need a database. It’s at a fairly early stage of development, but if you pull down the latest code from Subversion you’ll find that it does have a nice administration page that enables new feeds to be added very quickly without the need to go near any configuration files.

Still at the tinkering / experimentation stage, but this has been an interesting exercise so far.