Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save letunglam/9701883 to your computer and use it in GitHub Desktop.
Save letunglam/9701883 to your computer and use it in GitHub Desktop.

So yesterday brought the sad news that Google Reader is being killed off. C’est la vie it seems, given it was a Google product. In my search for an alternative I rediscovered Fever and decided to see if I could run it up for free on Heroku. Onwards...

Personally I think the news about Reeder is quite sad, as I would quite happily have paid for it as a service. In fact I like RSS so much that I actually shelled out the $30 for Fever when it first came out years ago (I was also pretty massive Shaun Inman fanboy if I’m being honest).

I ended up setting Fever aside because screw having to manage self-hosting for PHP and MySQL, right?

If you’re new to Fever I recommend going and checking it out, but also reading the post in response to the Google Reader announcement by Fevers author, Shaun, for a good list of what Fever is and isn’t.

Enough jibba-jabba!

Let’s turn up the heat!

OK, so I’m going to go ahead and just assume that if you’re reading this then you are already probably familiar with Heroku and already have an account and their toolchain already set up on your machine (for the sake of not having a bad time I’m also going to assume you are not using Windows, because LOL).

First up we need to make a local repo for fever to live in and for us to deploy to Heroku from.

Setup

Let’s open Terminal and mash some keys;

mkdir fever
cd fever
git init .

…and now we’ll grab the Fever bootstrap code and commit it. We also need to add an empty index.php file to the root of our app. This is required as this is how Heroku will identify it as being a PHP deployment…

wget http://feedafever.com/gateway/public/fever.zip
unzip fever.zip -d . && rm fever.zip
touch index.php
git add -A .
git commit -m "Added Fever bootstrap code, Heroku index.php"

Heroku

OK, so running PHP on Heroku is not officially supported, but it is easy—thanks to iphoting’s awesome PHP + nginx, etc… custom buildpack.

In your terminal in your local repo we will first create a new Heroku app…

heroku create -s cedar -b git://github.com/iphoting/heroku-buildpack-php-tyler.git

…and then add the ClearDB MySQL addon (don’t worry the ignite version is free)

heroku addons:add cleardb:ignite

Now push!

git push heroku master

Fever

Once the post-recieve hook has finished up (it will do a bunch of stuff to pull down binaries for our buildpack) you should head over to the Fever bootstrap script in your browser and follow the steps there.

heroku open

…and navigate over to /fever/boot.php

Towards the end you will need to go grab out your database credentials, these can be found by running…

heroku config | grep CLEARDB_DATABASE_URL | cut -d " " -f2 | php -r '$conn=""; $in=fopen("php://stdin", "r"); while(!feof($in)){ $conn=$conn . fgets($in, 4096); } print_r(parse_url($conn));'

…locally (note that path is the database name, just leave out the / at the start).

Awesome—you should now have Fever up and running! You just scored a very capable RSS reader for the worth-while one-off cost of $30m and set up free managed hosting for it for eternity (or until Google buys Heroku and then shuts them down ;).

Get reading!


Bonus Round!

By default Fever will refresh feeds on page load, however they do provide a method for triggering a refresh via a web-hook, which you can hit from a cron task.

If this sounds like something you might be interested in then install and configure the Heroku scheduler addon:

heroku addons:add scheduler:standard
heroku addons:open scheduler

You’ll want to set the command field to:

curl -L -s http://YOUR_HEROKU_APP/fever/?refresh

Save and you’re done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment