Skip to content

Instantly share code, notes, and snippets.

@plasticine
Created March 16, 2013 09:00
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save plasticine/5175588 to your computer and use it in GitHub Desktop.
Save plasticine/5175588 to your computer and use it in GitHub Desktop.
Fever on Heroku

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.

@mattbischoff
Copy link

Thanks for the great walkthrough. One typo: "Personally I think the news about Reeder". Should be Reader.

@keith
Copy link

keith commented Mar 17, 2013

+1 since Reeder actually does support Fever (the iPhone version) and of course https://twitter.com/reederapp/status/311995748482945025

@robbfitzsimmons
Copy link

Good walkthrough!

I struggled through over the weekend without the custom buildpack, but eventually got it to work with this method:
https://github.com/robbfitzsimmons/fever#fever-rss-reader-tweaked-for-herokuaws

@mtylty
Copy link

mtylty commented Mar 30, 2013

Thanks, great job! Old copy-and-paste worked great!

@maloninc
Copy link

maloninc commented Apr 6, 2013

Thanks for great work!

@letunglam
Copy link

On November 4th, 2015, the classic Cedar stack will be retired and any apps that have not been migrated to Cedar-14 will stop running. I tried upgrade to Cedar-14 and failed to push to Heroku.

Is there any solution to make it work with Cedar-14 stack?

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