techmonkey Posted March 13, 2011 Share Posted March 13, 2011 I recently started using http://tumblr.com and although it isn't as popular as Twitter, it has other benefits (such as no character limitation) That got me thinking, that if we can get our now playing updating twitter every 10 minutes then it must be possible with tumblr. I couldn't find a script that would take a twitter post and cross post to Tumblr, nor could I find one for Shoutcast to Tumblr, so I created one, then decided to merge it with the existing twitter one we use and came up with the attached! Please note that there are two areas you need to configure in twitter.php (the only file you need to edit) At the top of the file, the twitter and shoutcast settings #Consumer key token $consumer_key = 'YOUR TWITTER COMSUMER KEY HERE'; #Consumer secret token $consumer_secret = 'YOUR TWITTER COMSUMER SECRET TOKEN HERE'; #Access Token $token = 'YOUR TWITTER ACCESS TOKEN HERE'; #Access Token Secret $secret= 'YOUR TWITTER ACCESS SECRET TOKEN HERE'; $twitterObj = new EpiTwitter($consumer_key, $consumer_secret, $token, $secret); $twitterObjUnAuth = new EpiTwitter($consumer_key, $consumer_secret); $refresh = "600"; // Page refresh time in seconds. Put 0 for no refresh $timeout = "5"; // Number of seconds before connecton times out - a higher value will slow the page down if any servers are offline $ip = "YOUR STATION'S IP ADDRESS"; $port = "YOUR STATIONS PORT NUMBER"; and further down the page //START TUMBLR CONFIGURATION $tumblr_email = 'YOUR TUMBLR EMAIL ADDRESS'; $tumblr_password = 'YOUR TUMBLR PASSWORD'; // Data for new record $post_type = 'regular'; $post_title = 'Recently played'; $post_body = $song . ' http://Station URL HERE'; Please make sure you edit both sections. Also, make sure that title.txt is writeable on your server. We keep twitter.php open in the background so it refreshes and posts every 10 minutes I've included the pal script from the original, although we don't use SAM Broadcaster anymore (Go RadioDJ!) and this script should work whatever program you are using to stream! Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now