View Single Post
Old 28th February 2009, 15:49   #19
Michael T.
Member
 
Join Date: Nov 2004
Posts: 99
Quote:
Originally posted by 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
That looks pretty cool. Just edit the
$twitter_username ='username';
$twitter_psw ='password';
section of the twitterAPI with my twitter username and password?

and edit the
// High bitrate
$ip[1] = "123.123.123.123";
$port[1] = "8000";

// Medium bitrate
$ip[2] = "123.123.123.123";
$port[2] = "8002";

// Low bitrate
$ip[3] = "123.123.123.123";
$port[3] = "8004";?

section of the twitter_multi file with the server addresses and upload? I want to make sure I understand it all before I upload.

Last edited by Michael T.; 28th February 2009 at 16:29.
Michael T. is offline   Reply With Quote