Running River4 On the Cheap: Locally and with Dropbox

The latest release of River4 allows a user to bypass Amazon S3 and instead write all data to the local machine. This is big news -- the cost of bandwidth and all of the reading/writing from the node.js installation to Amazon is not cheap. Although Dave Winer has said that the "river of news" is not a feed reader, they feel equivalent enough that I don't want to be paying $20 a month just to create JSON files and host a river, when competitive feed readers are much less expensive.

The initial problem with running River4 locally is that one would need to use the web server as a host, and not all web servers have that capability. For instance, I am running River4 on a VPS that does not have a fixed IP address. However, there is a workaround: Dropbox. One can't view the index.html file of the river on the web (even when made shareable) but one can make all of the JSON files shareable, and plug them in where they are referenced.

I created a river4 subdirectory in Dropbox, put a lists folder in it, and added my OPML files. Because I have Dropbox installed on my Linux VPS, river.js can read/write to/from that subdirectory. All I had to do was go into .bashrc, put a # in front of my original s3path, and add the following line:

export fspath=/root/Dropbox/river4/

After source ~/.bashrc I stopped and restarted river.js, and the app started to write files to the Dropbox folder. I then had to make the JSON files shareable. For example, if I go to Dropbox/river4/rivers and make daveWiner.js shareable, I get To show the raw code, I change www to dl and hit enter, and get I can now plug this into the Settings at the Radio3 River Browser or replace the URL in the riversArray.json file in the data folder (although you'll have to do that in a copy in a different folder, otherwise the app will just rewrite over it if you add a new OPML file to the lists folder). Then I go to (as of this writing) line 706 of the index.html file and change the following line

readHttpFile ("data/riversArray.json", function (jsontext) {

such that the file that it reads points to where you are hosting the JSON file. This could be the shared Dropbox URL, if you change the URL to show the raw code.

Special thanks to Chris Dadswell for helping me think this through.

Want to comment? The permalink for this post is

Last built: Tue, Mar 31, 2015 at 2:04 PM

By Jeffrey Kishner, Friday, September 26, 2014 at 12:14 PM.