Is there any way to get it to display the song titles. All I see on my page is Now Playing: 0 - Listeners
Announcement
Collapse
No announcement yet.
Twittercast: Shoutcast / Icecast Song Title To Twitter Status PHP Script
Collapse
X
-
twiter casting
ive edited the code but for some reason its not posting anyting can someone look at the code and help me out.
thanks
PHP Code:<?php
$timeout = "5"; // Number of seconds before connecton times out - a higher value will slow the page down if any servers are offline
$ip[1] = "66.96.29.176";
$port[1] = "8000";
$servers = count($ip);
$i = "1";
while($i<=$servers)
{
$fp = @fsockopen($ip[$i],$port[$i],$errno,$errstr,$timeout);
if (!$fp)
{
$listeners[$i] = "0";
$msg[$i] = "<span class=\"red\">ERROR [Connection refused / Server down]</span>";
$error[$i] = "1";
}
else
{
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace('<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>', "", $info);
$info = str_replace('</body></html>', "", $info);
$stats = explode(',', $info);
if (empty($stats[1]) )
{
$listeners[$i] = "0";
$msg[$i] = "<span class=\"red\">ERROR [There is no source connected]</span>";
$error[$i] = "1";
}
$song[$i] = $stats[6];
}
$i++;
}
require('twitterAPI.php');
$fh = @fopen('title.txt', 'r+');
$track = @fread($fh, filesize('title.txt'));
if ($track == $song[1]."\n"){
fclose($fh);
die(0);
}else{
@fclose($fh); // if it errors, then the file doesn't exist, and the stream was never open
$fh = fopen('title.txt', 'w');
fwrite($fh, $song[1]."\n");
if (strstr($song[1],"[Live!]")){
$twitter_status=postToTwitter($twitter_username, $twitter_psw, '#YorkVilleStudio - Now Playing: '.$song[1] .' - ' .$total_listeners .' Listeners - http://yorkvillestudios.com');
}
}
fclose($fh);
?>
Comment
-
Would be heavy if someone could host a working version of this, had the same problem for the past month now
Much appreciated if someone does this im sure many people are after a new release/runinng releasecode:
About to connect() to twitter.com port 80 (#0)
* Trying 168.143.162.36...
* Connected to twitter.com (168.143.162.36) port 80 (#0)
authization stuff
Host: twitter.com\r
Accept: */*\r
HTTP/1.1 413 Request Entity Too Large
Comment
-
Hi I've been using this for sometime but its all of a sudden stopped working. My host stated there have not changed anything and I don't think twitter has blocked the script.
my twitter page : http://www.twitter.com/summertimeradio
my twittercast script http://www.summertimeradio.com/twitt...cast_multi.php
Does anybody have an idea what this could bewww.summertimeradio.com /Dance Music 24/7
Comment
-
Hello everyone,
I've tried several scripts but none works 100% for me. the point is that I have a problem with characters like áéçâêã, see the error in my twitter http://twitter.com/mixtotalfm (the first message has been posted by twitterscript and the last message by me)
When the message with the song title with special character is posted, then the twitter "cuts" the two letters from the front. Someone did the test using these characters? áéÃóúã
I think it's something related to the type of character in the twitter API. Someone has any idea how to solve this problem?
Regards.
Comment
-
My script still isn't working but below is the error I'm getting when running it. I can confirm the output is less than 140 charaters and twitter hasn't blocked my IP address of host. Anybody can help? I'm able to post to twitter with other scripts that are running on my website
* About to connect() to twitter.com port 80 (#0)
* Trying 128.121.146.228... * connected
* Connected to twitter.com (128.121.146.228) port 80 (#0)
* Server auth using Basic with user 'summertimeradio'
> POST /statuses/update.xml?status=Is+Currently+Playing%3A+Pursuit+-+Classics+Mix HTTP/1.1
Authorization: Basic c3VtbWVydGltZXJhZGlvOnN1bW1lcjF0aW1lMg==
Host: twitter.com
Accept: */*
Content-Length: -1
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
< HTTP/1.1 413 Request Entity Too Large
< Date: Tue, 18 May 2010 19:11:38 GMT
< Server: hi
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
<
* Closing connection #0www.summertimeradio.com /Dance Music 24/7
Comment
-
-
Originally Posted by Biggus View PostHi I've been using this for sometime but its all of a sudden stopped working. My host stated there have not changed anything and I don't think twitter has blocked the script.
my twitter page : http://www.twitter.com/summertimeradio
my twittercast script http://www.summertimeradio.com/twitt...cast_multi.php
Does anybody have an idea what this could be
Can we get some help with this please?
Our script has stopped working.
Comment
-
I uploaded my working version of Twittercast. Thanks again to Dopelabs for this script and thanks for helping me out in the thread.
Here's the link:
http://www.odiggy.com/shoutcastscrip...wittercast.zip
Note: I used stristr() so that the keyword "Live" was not case sensitive.
Also check out the quick little readme.txt I made. Oh and I don't think this will work with that new Shoutcast 2, it pulls the song info from 7.html.
Cheers!
Comment
-
Originally Posted by odogg View PostI uploaded my working version of Twittercast. Thanks again to Dopelabs for this script and thanks for helping me out in the thread.
Here's the link:
http://www.odiggy.com/shoutcastscrip...wittercast.zip
Note: I used stristr() so that the keyword "Live" was not case sensitive.
Also check out the quick little readme.txt I made. Oh and I don't think this will work with that new Shoutcast 2, it pulls the song info from 7.html.
Cheers!
Please help me if u can.
Comment
Comment