View Single Post
Old 18th February 2009, 02:00   #6
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 531
Send a message via AIM to dopelabs
The way this works is. the script will check the shoutcast server for the currently playing song. It then checks the title.txt for the same title info... if the title.txt file is empty, or it has different title info, it will send that data to twitter, and it will also write that to the title.txt file.

This script will ONLY update the title info if its different from the last time it checked, thus not posting the same title every min. (or however long you set your cron job for)

here is an example of a cron job that could be used:

*/10 * * * * wget -O /dev/null http://www.domain.com/twittercast.php >> /dev/null 2>&1

things to keep in mind:

make sure the title.txt file is writable by your webserver (chmod 777 title.txt) and in the same directory as everything else.

make sure there actually IS title info on your shoutcast server..

just visit your shoutcast server in your browser to check that.


I am also posting a new version.

Changes:

Support for multiple servers
Added listener count to twitter output
Added page refresh for automatic in-browser updates


see working examples at www twitter com / dubstepfm
Attached Files
File Type: zip twittercast_multi.zip (2.8 KB, 2321 views)

Last edited by dopelabs; 18th February 2009 at 03:04.
dopelabs is offline   Reply With Quote