TweetPull for RSS

Create an RSS feed of a selected Twitter user's recent tweets using the v1.1 API.

Contributors: sahearn
Tags: Twitter, tweet, API, RSS

Questions/Comments: sahearn at gmail dot com



For some time, Twitter RSS-enabled a user's stream, meaning one could essentially follow a user without interacting with the Twitter front-end website (or app). This allowed one to add one of two specifically-crafted URLs into their RSS reader of choice:[numeric twitter id].rss , or[twitter screen name]

This was great for people like me who are devoted to RSS, want to follow people on Twitter, but generally hate sifting through the streaming mess of the Twitter site. However, in the summer of 2013, Twitter officially deprecated v1 of its API, and released v1.1; and with it, they removed the ability to make un-authenticated requests to the API. This effectively killed any ability to quickly and easily pull recent tweets via a simple URL.

What You'll Need


Since the v1.1 API allows authenticated requests to a large number of very useful methods, the first step was to sign in to the Twitter Developer site and create an application that would authenticate back to me. This is done via creation of "consumer keys" and "access tokens" that are unique to the developer and are placed in the request header.

The next step was to find a way to create a valid request header with my keys/credentials along with my desired get method (in my case, statuses/user_timeline). GitHub user themattharris made all the authentication portion incredibly easy by developing an OAuth library written in PHP.

Once the request was formed, my code was then a matter of extracting the JSON response, parsing the user's tweets, and dropping them to a well-formed RSS/XML file. This might seem like an involved and somewhat unnecessary approach, but my primary reasoning was due to Twitter's API rate limiting. Read that, and the following "gotchas" should make more sense:

In general, a lot of improvements can be made here, but it's good enough for a v0.1 release. And I only did it because the v1.1 API is so new, I couldn't find anyone else doing something similar yet.


Latest: v0.4 (Apr 2014) - via GitHub

License: This script is released under the Apache v2.0 License. Please note the tmhOAuth library is also published under Apache v2.0. Please use accordingly.



  1. Download tmhOAuth library
  2. Download latest version of TweetPull for RSS package above
  3. Open tweetpull-config.php config file and set the following required parameters (descriptions for each appear in config file):
  4. Review and set the optional parameters in the tweetpull-config.php config file


  1. Follow Installation steps above
  2. Run the script (typically by cron) with the following:

    5 * * * * php /full/path/to/tweetpull.php -u [twitter screen name] [-r] [-t]

    -r is an optional parameter. If it is set, replies are removed from the returned timeline. See statuses/user_timeline for more info.
    -t is an optional parameter. If it is set, retweets are removed from the returned timeline. See statuses/user_timeline for more info.
  3. Output file(s) will be [twitter screen name].xml. Enter that file (with full URL) into your favorite RSS reader. (e.g.[twitter screen name].xml)








To-do List

Updated: 25 Aug 2017