/tweetsToRss

A node.js app that periodically reads a Twitter account and generates an RSS feed from it.

Primary LanguageJavaScriptMIT LicenseMIT

What it is

A node.js app that periodically reads a Twitter account and generates an RSS feed from it.

Written by Dave Winer.

Overview

Once it's set up, every minute it gets the most recent tweets for one Twitter account, and writes an RSS file with the content of those tweets.

I've included an example feed in the repo to show you what one looks like.

Set up with Twitter

You need to set four environment variables, to connect this app with Twitter.

To begin, create a new app at apps.twitter.com. From there, you'll need to set environment variables with these four values.

  1. twitterConsumerKey

  2. twitterConsumerSecret

  3. twitterAccessToken

  4. twitterAccessTokenSecret

You can get these values by clicking on the Test OAuth button in apps.twitter.com, as shown in this screen shot.

All four values are shown on that page. Perfect. ;-)

Which Twitter account, where to save the feed

twitterScreenName -- the screen_name of the user whose timeline you want to convert to RSS. Examples of screen names: davewiner, nyt, dsearls, nakedjen.

pathRssFile -- this is the local filesystem path for the file we'll maintain. It's optional, if you don't specify it we write the file as rss.xml in the same folder as the app.

Managing multiple feeds

In version 0.45 I added a feature that allows you to watch more than one Twitter account, producing a separate RSS feed for each.

If there's a file called config.json in the same folder as tweetstorss.js, the app will read it every minute, and use the accounts listed in the file, instead of the twitterScreenName environment variable.

Here's an example of the config.json file that's running on my system.

  1. The folder value says where to store the generated RSS feeds. It can be a relative path as shown in the example, or can be a path from the root of your filesystem.

  2. The items array is a set of objects, each of which specifies a Twitter username and the name of the RSS file created from the account.

Because we read config.json every time we do a scan, you can change the file without having to relaunch tweetstorss.js.

Questions, comments?

Please use the server-snacks list for support.