RSS to Twitter PHP Script
This PHP Script will go through your RSS feed and post an item from it to your Twitter every X minutes (X interval in configurable).
The script is smart enough to not post the same RSS feed item more than once.
It will also include a random hashtag with each tweet from a list of hashtags you enter in the config file.
The script uses the Twitter API.
Installation
1. Go to https://apps.twitter.com/ and click "Create New App" to get your consumer key, consumer secret, oauth token and oauth secret .
2. Edit the file rss_to_twitter/src/cron.php to add your consumer key, consumer secret, oauth token, oauth secret, list of hashtags you want to use and your RSS feed URL.
3. Upload the contents of rss_to_twitter/src/ to a location somewhere on your server.
4. Make sure server has write permissions to the file already_posted.txt by running the following command:
chown www-data:www-data /[path you uploaded to]/already_posted.txt
(usually www-data is the right username but if not replace each occurrence of www-data with your server's user id)
5. Point your browser to cron.php (wherever you uploaded it to) to test the script.
6. If it's not working contact [email protected], if it is working continue to step 7.
7. Use the command:
crontab -e
to edit your crontab file and add the following line:
*/15 * * * * wget -O- http://[your website]/[server directory you uploaded to]/cron.php > /dev/null
Replace 15 with the number of minutes you want between each tweet
8. That's it, you're done. If you have any problems don't hesitate to contact [email protected]