Read an RSS feed and submit any new links to Twitter using PHP5.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


RSS to Twitter using PHP 5

By: Colin Devroe


Grabs an RSS feed and updates a single Twitter account with a link to any new post.


  1. Register your app at: (Be sure to set it up as Read & Write!)
  2. Update the Setup area of rss2twitter.php
    1. This includes consumerKey,consumerToken,oAuthToken,oAuthTokenSecret from dev.twitter, RSS feed URL, and Cache directory (optional)
  3. Authorize your domain for the application on dev.twitter
    1. To setup a test you can always add localhost
  4. Make the /cache/ directory writable or change its location
  5. Copy to your server.
  6. Set up cron job. Example: /usr/local/php5/bin/php /path/to/script/rss2twitter.php

That’s it!


RSS to Twitter is released under the GPL License. This license is provided in license.txt. The Twitter class by Tijs Verkoyen is released under the BSD License and that is included in twitter.php

To do:

(If anyone would like to take these on, please feel free.)

  1. Add an option to easily update the tweet syntax.

Version History:

*2.0 – December 29, 2010
- Now uses OAuth for authentication
- Removed option to tweet only a single blog category
- Added Twitter class by Tijs Verkoyen
- Improved caching
- Updated Readme.textile

*1.0 – December 29, 2010
- Tagged and branched for future revision

0.4 – January 25, 2010
- Changed wpUrl to feedUrl
- Changed shortUrl to $post→link

0.3 – January 24, 2010
- categoryToTwitter is optional
- Took away the “plural category name” check

0.2 – January 22, 2010
- Slight code clean up.
- A few readme changes.

0.1 – December 6, 2009
- Initial codebase.