Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Discussions

Reply
Thread Tools Search this Thread Display Modes
Old 7th March 2015, 16:16   #361
IamJay
Junior Member
 
Join Date: Mar 2014
Posts: 21
yes thats the lenght of the tracks when auto dj is on, when a dj is playing you know it changes like every minute
IamJay is offline   Reply With Quote
Old 7th March 2015, 16:49   #362
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
i was asking how long each track is on your autodj.

you have it set to check every min. if the track title changes every min. it will post ever min. if the track title doesnt change, twitter will not post duplicate tweets....
dopelabs is offline   Reply With Quote
Old 9th March 2015, 01:06   #363
IamJay
Junior Member
 
Join Date: Mar 2014
Posts: 21
i know that but it doesn't tweet anymore and i have it configured,
IamJay is offline   Reply With Quote
Old 9th March 2015, 01:23   #364
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
so are you going to tell me how long the tracks are when your auto dj is on?
dopelabs is offline   Reply With Quote
Old 9th March 2015, 13:25   #365
IamJay
Junior Member
 
Join Date: Mar 2014
Posts: 21
2-3 minutes now.. but when i have mixtapes in the auto dj its 45 minutes
IamJay is offline   Reply With Quote
Old 9th March 2015, 13:44   #366
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
well it sounds like everything is working properly then.
dopelabs is offline   Reply With Quote
Old 10th March 2015, 14:38   #367
IamJay
Junior Member
 
Join Date: Mar 2014
Posts: 21
but it is not posting the tweets at all now
IamJay is offline   Reply With Quote
Old 10th March 2015, 15:31   #368
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
please show me the source code to your script. what does your webserver error log show?
dopelabs is offline   Reply With Quote
Old 11th March 2015, 15:34   #369
IamJay
Junior Member
 
Join Date: Mar 2014
Posts: 21
code:
[Sun Mar 08 14:55:23 2015] [error] [client 72.252.135.83] PHP Fatal error: Uncaught exception 'EpiTwitterForbiddenException' with message '{"errors":[{"code":226,"message":"This request looks like it might be automated. To protect our users from spam and other malicious activity, we can't complete this action right now.
Please try again later."}]}' in /var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/EpiTwitter.php:265\nStack trace:\n#0 /var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/EpiTwitter.php(226): EpiTwitterException::raise(Object(EpiCurlManager), false)\n#1
/var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/EpiTwitter.php(127): EpiTwitterJson->__get('response')\n#2
/var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/EpiTwitter.php(44): EpiTwitter->request('POST', '/statuses/updat...', Array)\n#3
/var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/shoutcast_v1.php(85): EpiTwitter->post('/statuses/updat...', Array)\n#4 {main}\n thrown in /var/zpanel/hostdata/zadmin/public_html/generationspot_tk/twittercast/EpiTwitter.php on line 265, referer: http://vybzyaad.net/



Mostly that

PHP Code:
<?php

include 'EpiCurl.php';
include 
'EpiOAuth.php';
include 
'EpiTwitter.php';

#Consumer key token
$consumer_key '7wZbqQS4JnaxGbtlDd.......T';

#Consumer secret token
$consumer_secret 'aKrjVf91vCn9vWURDK9VEwugKYtdy9oO9hNL4JSl5.......';

#Access Token
$token '1155093848-WpVoVEPj07iJJBFXs060KfkFjZ.........';

#Access Token Secret 
$secret'PycZEvPT3XpZ7c3hLQCIONvnvXo8bASEGr..........';

$refresh "60";  // Page refresh time in seconds. Put 0 for no refresh. (only used if updating via browser)
$timeout "5"// Number of seconds before connecton times out.

$ip***91;1***93; = "vybzyaad.net"// IP address of shoutcast server
$port***91;1***93; = "8010"// Port of shoutcast server

//END CONFIGURATION
$twitterObj = new EpiTwitter($consumer_key$consumer_secret$token$secret);
$twitterObjUnAuth = new EpiTwitter($consumer_key$consumer_secret);

$servers count($ip);
$i "1";
while(
$i<=$servers)
    {
    
$fp = @fsockopen($ip***91;$i***93;,$port***91;$i***93;,$errno,$errstr,$timeout);
    if (!
$fp
        { 
        
$listeners***91;$i***93; = "0";
        
$msg***91;$i***93; = "<span class=\"red\">ERROR ***91;Connection refused / Server down***93;</span>";
        
$error***91;$i***93; = "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***91;1***93;) )
            {
            
$listeners***91;$i***93; = "0";
            
$msg***91;$i***93; = "<span class=\"red\">ERROR ***91;There is no source connected***93;</span>";
            
$error***91;$i***93; = "1";
            }
        else
            {
            if (
$stats***91;1***93; == "1")
                {
                
$song***91;$i***93; = $stats***91;6***93;;
                
$listeners***91;$i***93; = $stats***91;4***93;;
                
$max***91;$i***93; =  $stats***91;3***93;;
                if (
$stats***91;0***93; == $max***91;$i***93;) 
                    { 
                    
$msg***91;$i***93; .= "<span class=\"red\">";
                    }
                if (
$stats***91;0***93; == $max***91;$i***93;) 
                    { 
                    
$msg***91;$i***93; .= "</span>";
                    }
                }
            else
                {
                
$listeners***91;$i***93; = "0";
                
$msg***91;$i***93; = "    <span class=\"red\">ERROR ***91;Cannot get info from server***93;</span>";
                
$error***91;$i***93; = "1";
                }
            }
        }
    
$i++;
    }

print 
"Now Playing: $song***91;1***93;"// so you can see what the output looks like

$twitterObj->post('/statuses/update.json', array('status' => '#NP ' .$song***91;1***93;. ' On #VYR Pc: http://goo.gl/tpbXDc Mobile: http://goo.gl/Cj9A9d')); // Tweet that shit. 

?>
IamJay is offline   Reply With Quote
Old 11th March 2015, 16:33   #370
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
well it tells you what the problem is directly in the error log there. try changing the msg posted to just the track name without any hash or urls. make it look like it's more of a human typed msg
dopelabs is offline   Reply With Quote
Old 13th March 2015, 01:56   #371
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Hi there. OK so I have it all set up on my server, twitter api info in, icecast server set but when I view he icecast.php page I only get a - here is the error log entry. Is there something I am missing? Thanks in advance for some help.

[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 0 in /home2/houseps6/public_html/twitterstream/icecast.php on line 73
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 1 in /home2/houseps6/public_html/twitterstream/icecast.php on line 74
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 2 in /home2/houseps6/public_html/twitterstream/icecast.php on line 75
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 3 in /home2/houseps6/public_html/twitterstream/icecast.php on line 76
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 4 in /home2/houseps6/public_html/twitterstream/icecast.php on line 77
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 5 in /home2/houseps6/public_html/twitterstream/icecast.php on line 78
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 6 in /home2/houseps6/public_html/twitterstream/icecast.php on line 79
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 7 in /home2/houseps6/public_html/twitterstream/icecast.php on line 80
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 8 in /home2/houseps6/public_html/twitterstream/icecast.php on line 81
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 9 in /home2/houseps6/public_html/twitterstream/icecast.php on line 82
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Undefined offset: 1 in /home2/houseps6/public_html/twitterstream/icecast.php on line 84
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Use of undefined constant artist - assumed 'artist' in /home2/houseps6/public_html/twitterstream/icecast.php on line 91
[12-Mar-2015 20:42:37 America/Denver] PHP Notice: Use of undefined constant track - assumed 'track' in /home2/houseps6/public_html/twitterstream/icecast.php on line 91
[12-Mar-2015 20:42:37 America/Denver] PHP Fatal error: Uncaught exception 'EpiTwitterNotAuthorizedException' with message '{"request":"\/1.1\/statuses\/update.json","error":"Read-only application cannot POST."}' in /home2/houseps6/public_html/twitterstream/EpiTwitter.php:263
Stack trace:
#0 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(226): EpiTwitterException::raise(Object(EpiCurlManager), false)
#1 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(127): EpiTwitterJson->__get('response')
#2 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(44): EpiTwitter->request('POST', '/statuses/updat...', Array)
#3 /home2/houseps6/public_html/twitterstream/icecast.php(91): EpiTwitter->post('/statuses/updat...', Array)
#4 {main}
thrown in /home2/houseps6/public_html/twitterstream/EpiTwitter.php on line 263
minstrelsghost is offline   Reply With Quote
Old 13th March 2015, 04:47   #372
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
its good that everyone can copy and paste their log files.. but before you do so, read through them carefully.

you may had noticed

code:
"error":"Read-only application cannot POST."


visit your application on the twitter dev site. grant write permissions/access on the app. you might have to generate a new keys, etc... but use the ladder.
dopelabs is offline   Reply With Quote
Old 13th March 2015, 16:15   #373
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Fixed Read Only but.....

OK, Read only issue done but every other error still exists, still only get the - So what now?

this is a new line

[13-Mar-2015 11:12:44 America/Denver] PHP Fatal error: Uncaught exception 'EpiTwitterForbiddenException' with message '{"errors":[{"code":187,"message":"Status is a duplicate."}]}' in /home2/houseps6/public_html/twitterstream/EpiTwitter.php:265
minstrelsghost is offline   Reply With Quote
Old 13th March 2015, 16:21   #374
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
OK, so it is posting to twitter but not pulling track info, only posts "#tag - http://url.com #notagbacks" just using as a test, will change info when is fixed.
minstrelsghost is offline   Reply With Quote
Old 13th March 2015, 16:24   #375
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
what does the log say?
dopelabs is offline   Reply With Quote
Old 13th March 2015, 18:40   #376
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Log

[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 0 in /home2/houseps6/public_html/twitterstream/icecast.php on line 73
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 1 in /home2/houseps6/public_html/twitterstream/icecast.php on line 74
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 2 in /home2/houseps6/public_html/twitterstream/icecast.php on line 75
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 3 in /home2/houseps6/public_html/twitterstream/icecast.php on line 76
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 4 in /home2/houseps6/public_html/twitterstream/icecast.php on line 77
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 5 in /home2/houseps6/public_html/twitterstream/icecast.php on line 78
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 6 in /home2/houseps6/public_html/twitterstream/icecast.php on line 79
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 7 in /home2/houseps6/public_html/twitterstream/icecast.php on line 80
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 8 in /home2/houseps6/public_html/twitterstream/icecast.php on line 81
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 9 in /home2/houseps6/public_html/twitterstream/icecast.php on line 82
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Undefined offset: 1 in /home2/houseps6/public_html/twitterstream/icecast.php on line 84
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Use of undefined constant artist - assumed 'artist' in /home2/houseps6/public_html/twitterstream/icecast.php on line 91
[13-Mar-2015 13:39:51 America/Denver] PHP Notice: Use of undefined constant track - assumed 'track' in /home2/houseps6/public_html/twitterstream/icecast.php on line 91
[13-Mar-2015 13:39:51 America/Denver] PHP Fatal error: Uncaught exception 'EpiTwitterForbiddenException' with message '{"errors":[{"code":187,"message":"Status is a duplicate."}]}' in /home2/houseps6/public_html/twitterstream/EpiTwitter.php:265
Stack trace:
#0 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(226): EpiTwitterException::raise(Object(EpiCurlManager), false)
#1 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(127): EpiTwitterJson->__get('response')
#2 /home2/houseps6/public_html/twitterstream/EpiTwitter.php(44): EpiTwitter->request('POST', '/statuses/updat...', Array)
#3 /home2/houseps6/public_html/twitterstream/icecast.php(91): EpiTwitter->post('/statuses/updat...', Array)
#4 {main}
thrown in /home2/houseps6/public_html/twitterstream/EpiTwitter.php on line 265
minstrelsghost is offline   Reply With Quote
Old 13th March 2015, 18:53   #377
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
did you read through this?

code:
"code":187,"message":"Status is a duplicate."
dopelabs is offline   Reply With Quote
Old 13th March 2015, 19:03   #378
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
I did read through that but this happens every time. Even 30 minutes later when it is obviously not a dup.... I have a question about status.xsl.... am I suppoesed to be generating one? Cause Centova cast does not have a way to do that... Can I use the centova pls file as the stats file?
minstrelsghost is offline   Reply With Quote
Old 13th March 2015, 23:12   #379
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
what does the page show when you visit it in a browser?

no, a pls file is not for stats.

the icecast server generates the stats page
dopelabs is offline   Reply With Quote
Old 14th March 2015, 18:45   #380
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
It only shows a -
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 19:36   #381
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Here is the xsl from my server...I see the issue but am not sure how to fix it.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Icecast Streaming Media Server</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<h2>Icecast2 Status</h2>
<br><div class="roundcont">
<div class="roundtop"><img src="/corner_topleft.jpg" class="corner" style="display: none"></div>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="4"><tr><td bgcolor="#656565">
<a class="nav" href="admin/">Administration</a><a class="nav" href="status.xsl">Server Status</a><a class="nav" href="server_version.xsl">Version</a>
</td></tr></table>
<div class="roundbottom"><img src="/corner_bottomleft.jpg" class="corner" style="display: none"></div>
</div>
<br><br><div class="roundcont">
<div class="roundtop"><img src="/corner_topleft.jpg" class="corner" style="display: none"></div>
<div class="newscontent">
<div class="streamheader"><table cellspacing="0" cellpadding="0">
<colgroup align="left"></colgroup>
<colgroup align="right" width="300"></colgroup>
<tr>
<td><h3>Mount Point /autodj</h3></td>
<td align="right">
<a href="/autodj.m3u">M3U</a><a href="/autodj.xspf">XSPF</a>
</td>
</tr>
</table></div>
<table border="0" cellpadding="4">
<tr>
<td>Stream Title:</td>
<td class="streamdata">House of Prog Stream</td>
</tr>
<tr>
<td>Stream Description:</td>
<td class="streamdata">House of Prog</td>
</tr>
<tr>
<td>Content Type:</td>
<td class="streamdata">audio/mpeg</td>
</tr>
<tr>
<td>Mount started:</td>
<td class="streamdata">14/Feb/2015:01:15:06 -0500</td>
</tr>
<tr>
<td>Bitrate:</td>
<td class="streamdata">192</td>
</tr>
<tr>
<td>Current Listeners:</td>
<td class="streamdata">4</td>
</tr>
<tr>
<td>Peak Listeners:</td>
<td class="streamdata">25</td>
</tr>
<tr>
<td>Stream Genre:</td>
<td class="streamdata">Progressive &amp; Independent</td>
</tr>
<tr>
<td>Stream URL:</td>
<td class="streamdata"><a target="_blank" href="http://houseofprog.com/">http://houseofprog.com/</a></td>
</tr>
<tr>
<td>Current Song:</td>
<td class="streamdata">Fractal Mirror - Lost In Clouds</td>
</tr>
</table>
</div>
<div class="roundbottom"><img src="/corner_bottomleft.jpg" class="corner" style="display: none"></div>
</div>
<br><br><div class="roundcont">
<div class="roundtop"><img src="/corner_topleft.jpg" class="corner" style="display: none"></div>
<div class="newscontent">
<div class="streamheader"><table cellspacing="0" cellpadding="0">
<colgroup align="left"></colgroup>
<colgroup align="right" width="300"></colgroup>
<tr>
<td><h3>Mount Point /live</h3></td>
<td align="right">
<a href="/live.m3u">M3U</a><a href="/live.xspf">XSPF</a>
</td>
</tr>
</table></div>
<table border="0" cellpadding="4">
<tr>
<td>Current Listeners:</td>
<td class="streamdata">0</td>
</tr>
<tr>
<td>Current Song:</td>
<td class="streamdata"></td>
</tr>
</table>
</div>
<div class="roundbottom"><img src="/corner_bottomleft.jpg" class="corner" style="display: none"></div>
</div>
<br><br><div class="roundcont">
<div class="roundtop"><img src="/corner_topleft.jpg" class="corner" style="display: none"></div>
<div class="newscontent">
<div class="streamheader"><table cellspacing="0" cellpadding="0">
<colgroup align="left"></colgroup>
<colgroup align="right" width="300"></colgroup>
<tr>
<td><h3>Mount Point /stream</h3></td>
<td align="right">
<a href="/stream.m3u">M3U</a><a href="/stream.xspf">XSPF</a>
</td>
</tr>
</table></div>
<table border="0" cellpadding="4">
<tr>
<td>Current Listeners:</td>
<td class="streamdata">0</td>
</tr>
<tr>
<td>Current Song:</td>
<td class="streamdata"></td>
</tr>
</table>
</div>
<div class="roundbottom"><img src="/corner_bottomleft.jpg" class="corner" style="display: none"></div>
</div>
<br><br>&nbsp;


<div class="poster">Support icecast development at <a class="nav" target="_blank" href="http://www.icecast.org">www.icecast.org</a>
</div>
</body>
</html>
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 22:00   #382
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
can i see the script source? you can leave out the api credentials and passwords
dopelabs is offline   Reply With Quote
Old 14th March 2015, 22:24   #383
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
It is the latest from github.....

<?php

include 'EpiCurl.php';
include 'EpiOAuth.php';
include 'EpiTwitter.php';

#Consumer key token
$consumer_key = 'xxxxxxxxxx';

#Consumer secret token
$consumer_secret = 'xxxxxxxxxxxxx';

#Access Token
$token = 'xxxxxxxxxxxxxxxxxx';

#Access Token Secret
$secret= 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

$twitterObj = new EpiTwitter($consumer_key, $consumer_secret, $token, $secret);
$twitterObjUnAuth = new EpiTwitter($consumer_key, $consumer_secret);

$SERVER = 'http://50.7.70.58:8669'; // url to icecast server and port
$STATS_FILE = 'http://50.7.70.58:8669/status.xsl?mount=/stream'; // path to status.xsl and mountpoint

// END CONFIGURATION

//create a new curl resource
$ch = curl_init();

//set url
curl_setopt($ch,CURLOPT_URL,$SERVER.$STATS_FILE);

//return as a string
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

//$output = our stauts.xsl file
$output = curl_exec($ch);

//close curl resource to free up system resources
curl_close($ch);

//build array to store our radio stats for later use
$radio_info = array();
$radio_info['server'] = $SERVER;
$radio_info['title'] = '';
$radio_info['description'] = '';
$radio_info['content_type'] = '';
$radio_info['mount_start'] = '';
$radio_info['bit_rate'] = '';
$radio_info['listeners'] = '';
$radio_info['most_listeners'] = '';
$radio_info['genre'] = '';
$radio_info['url'] = '';
$radio_info['now_playing'] = array();
$radio_info['now_playing']['artist'] = '';
$radio_info['now_playing']['track'] = '';

//loop through $ouput and sort into our different arrays
$temp_array = array();

$search_for = "<td\s[^>]*class=\"streamdata\">(.*)<\/td>";
$search_td = array('<td class="streamdata">','</td>');

if(preg_match_all("/$search_for/siU",$output,$matches)) {
foreach($matches[0] as $match) {
$to_push = str_replace($search_td,'',$match);
$to_push = trim($to_push);
array_push($temp_array,$to_push);
}
}

//sort our temp array into our ral array
$radio_info['title'] = $temp_array[0];
$radio_info['description'] = $temp_array[1];
$radio_info['content_type'] = $temp_array[2];
$radio_info['mount_start'] = $temp_array[3];
$radio_info['bit_rate'] = $temp_array[4];
$radio_info['listeners'] = $temp_array[5];
$radio_info['most_listeners'] = $temp_array[6];
$radio_info['genre'] = $temp_array[7];
$radio_info['url'] = $temp_array[8];
$x = explode(" - ",$temp_array[9]);
$radio_info['now_playing']['artist'] = $x[0];
$radio_info['now_playing']['track'] = $x[1];

?>

<?php foreach($radio_info as $title => $data) { switch($title) { case 'now_playing' : ?>
<?php print "$data[artist] - $data[track]"; // so you can see what the output looks like

$twitterObj->post('/statuses/update.json', array('status' => '#tag '.$data[artist].' - '.$data[track].' http://houseofprog.com #notagbacks'));
} } ?>
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 22:30   #384
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
the server and stats file format is

code:

$SERVER = 'http://127.0.0.1:8035'; // url to icecast server and port
$STATS_FILE = '/status.xsl?mount=/stream'; // path to status.xsl and mountpoint



you need to remove the host and port from the $STATS_FILE
dopelabs is offline   Reply With Quote
Old 14th March 2015, 22:34   #385
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
I had that removed and it still does the same thing...
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 22:36   #386
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
And now when I remove it I get a 500 Error or the same this.....just a -
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 22:43   #387
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Looking at the icecast xsl I don't see anything that says 'artist' or 'track' what is puts out is Current Song: then both artist - track
minstrelsghost is offline   Reply With Quote
Old 14th March 2015, 23:44   #388
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
in the config the mountpoint is currently set to /stream
code:

$STATS_FILE = '/status.xsl?mount=/stream'; // path to status.xsl and mountpoint




looking at the html you posted of your status page its showing no current song and 0 listeners for /stream

code:

<td><h3>Mount Point /stream</h3></td>
<td align="right">
<a href="/stream.m3u">M3U</a><a href="/stream.xspf">XSPF</a>
</td>
</tr>
</table></div>
<table border="0" cellpadding="4">
<tr>
<td>Current Listeners:</td>
<td class="streamdata">0</td>
</tr>
<tr>
<td>Current Song:</td>
<td class="streamdata"></td>



you might want to try changing the mountpoint in the config to /autodj
dopelabs is offline   Reply With Quote
Old 14th March 2015, 23:58   #389
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
even if I try mount point /live since there is a live dj right now I get a 500 time out error or just the dash
minstrelsghost is offline   Reply With Quote
Old 15th March 2015, 00:12   #390
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
And no error log now...just a dash on the test page...and it takes nearly 2 minutes or more to actually refresh...
minstrelsghost is offline   Reply With Quote
Old 15th March 2015, 00:15   #391
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
strike that....4-5 minutes...
minstrelsghost is offline   Reply With Quote
Old 15th March 2015, 00:45   #392
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
its working fine for me.

viewed the icecast.php file in 'raw' mode on github
https://github.com/dlnetworks/twittercast

copied and pasted it to a new file called icecast.php
edited the config to match your station

code:

$SERVER = 'http://50.7.70.58:8669'; // url to icecast server and port
$STATS_FILE = '/status.xsl?mount=/autodj'; // path to status.xsl and mountpoint



saved the file
http://twittercast.dlnetworks.net/demo/icecast.php

looks like its working just fine.
dopelabs is offline   Reply With Quote
Old 15th March 2015, 00:50   #393
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
nope, just did the same...and get nothing...5 minute page load spin and then the -

must be my server...
minstrelsghost is offline   Reply With Quote
Old 15th March 2015, 00:55   #394
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
where is your script hosted? sometimes hosting providers block outbound access to non standard web ports if your on a shared host. i just confirmed the script to be working, its getting the data properly from your shoutcast server. you should contact your hosting support or check their faq/policies
dopelabs is offline   Reply With Quote
Old 15th March 2015, 00:57   #395
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
BLUE HOST it is shared but I am a reseller...
minstrelsghost is offline   Reply With Quote
Old 15th March 2015, 01:02   #396
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
https://my.bluehost.com/cgi/help/405
dopelabs is offline   Reply With Quote
Old 16th March 2015, 15:39   #397
minstrelsghost
Junior Member
 
Join Date: Mar 2015
Posts: 17
Yep, I found that too Thanks for your help, sorry to have wasted your time.
minstrelsghost is offline   Reply With Quote
Old 28th April 2015, 18:22   #398
wdepradio
Junior Member
 
Join Date: Apr 2015
Posts: 20
Wordpress Help

Hello I am trying to set the Twittercast for Shoutcast up on my Wordpress.org website http://www.wdepradio and am having problems getting the code to work can anyone of you help me out with this?
wdepradio is offline   Reply With Quote
Old 28th April 2015, 22:08   #399
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 350
Send a message via AIM to dopelabs
please provide any web server error logs, php error logs. also please confirm with your webhost that outbound access to the port of your radio server is enabled/allowed.
dopelabs is offline   Reply With Quote
Old 28th April 2015, 23:53   #400
wdepradio
Junior Member
 
Join Date: Apr 2015
Posts: 20
Can you clarify what you mean by webhost? I haven't got any errors. I did post the code is my css style page and nothing happened. Am I supposed to put it in the stylesheet or somewhere else on the website. My Shoutcast hosting company directed me here to get the Twittercast plugin for my stream. I'm not that good at writing code so a lot of what you guys are talking about is foreign to me.
wdepradio is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump