Go Back   Winamp & SHOUTcast Forums > SHOUTcast > SHOUTcast Discussions

Reply
Thread Tools Search this Thread Display Modes
Old 27th August 2017, 18:39   #481
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
so right now the script takes advantage of twitters ability to deny a new tweet if its identical to the last. if you were to include the listener count, you would potentially have a new tweet every time you call the script, since the listener count could be different, thus in turn the tweet would be different from the last because of the listener count.

for those who have the script setup to be called via a cron job or having the page auto refresh in the browser, that could be as often as once a minute, or how often the refresh timeout is set within the script.

if however you have things setup so that your calling the script when the track changes things would be a bit easier.

i currently have a script called 'metapush' which checks the playlist history file thats generated by the source software. it checks once a minute. if theres a new entry at the end of the list, i have it call the twittercast script, send the title updates out to all my streaming servers, update the titles that get displayed on the website, in the mobile apps, within the video stream, etc.

i have re-added the auto refresh into the code on github.
dopelabs is offline   Reply With Quote
Old 27th August 2017, 19:09   #482
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
i have also re-added support for multiple servers, and displaying the listener count as an option.
dopelabs is offline   Reply With Quote
Old 27th August 2017, 19:12   #483
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
The script I use at present runs on a 1 minute cron and shows the listener numbers, but changes in the listener total doesn't trigger a repost of the tweet.

The script is called when the track changes as the listener numbers are generated by the Twittercast [Shoutcast] script and not the stream title.

Hope that helps.

Would you like me to pm you the scripts I'm using now..

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 27th August 2017, 20:12   #484
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
alright i have modified the script so that it will only send a status update if the track is different from the last time it checked using a static text file.
dopelabs is offline   Reply With Quote
Old 28th August 2017, 00:48   #485
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
We are nearly there..

It's posting to Twitter, but it's not showing the title or the correct listener count.

Can you please confirm I have the correct format for Shoutcast 1 server:

$ip[0] = "fr1.1mix.co.uk";
$port[0] = "8000";
$sid[0] = "1";

Also it's not generating the title.txt file and I have this set as /TwittercastNew/title.txt where the path from the root is public_html/TwittercastNew/title.txt

Many thanks again for your help.

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 28th August 2017, 17:36   #486
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
format is correct.

make sure you have set permissions 777 on the title.txt file
dopelabs is offline   Reply With Quote
Old 28th August 2017, 17:39   #487
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
for the path specify the full path

/home/username/public_html/TwittercastNew/title.txt

or the path relative to the script... if the title.txt file and shoutcast.php are in the same directory. just specify 'title.txt' in the path config option


also if you want, while testing,

// comment out the line that posts to twitter

so you can check the output without having it post every time, once your satisfied with the output that you see in the browser, you cn then

uncomment that line again and it will start posting
dopelabs is offline   Reply With Quote
Old 28th August 2017, 18:15   #488
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
Many thanks for the replies..

I have set title.txt to 777 as suggested.

I've changed the path to just title.txt as it's in the same folder as all the other files.

I uploaded an updated title.txt with a dummy track title and refreshed the page and nothing changed. I then viewed title.text and found it was blank.

Can you explain which line to comment out to prevent it from posting please..

http://fr1.1mix.co.uk/TwittercastNew/shoutcast.php
http://fr1.1mix.co.uk/TwittercastNew/title.txt

Thanks again..

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 28th August 2017, 18:35   #489
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
code:
// $twitterObj->post('/statuses/update.json', array('status' => $tweet));



like that
dopelabs is offline   Reply With Quote
Old 28th August 2017, 18:37   #490
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
also.. make a copy of your shoutcast.php file rename it to something.txt, remove your api credentials from the top and then pm me the url to the txt so i can see the source
dopelabs is offline   Reply With Quote
Old 28th August 2017, 18:48   #491
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
ok i think i got it.. no need to send me the source. grab the updated code from github
dopelabs is offline   Reply With Quote
Old 28th August 2017, 18:48   #492
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
I've pm'd you the shoutcast.php file as that was easier..

Thanks again

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 28th August 2017, 19:14   #493
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
I've updated everything below // END CONFIGURATION and it's still the same I'm afraid..

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 28th August 2017, 19:24   #494
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
again. get the new code from github. please look at it carefully... there are changes made to the server blocks...
dopelabs is offline   Reply With Quote
Old 29th August 2017, 10:47   #495
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
Many thanks for all your hard work on this - I'm pleased to say that correcting my errors, and updating to the latest script and now it seems to be working..

Thanks so much

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 29th August 2017, 16:43   #496
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
excellent glad its workin for ya...
dopelabs is offline   Reply With Quote
Old 30th August 2017, 03:56   #497
Breenda
Junior Member
 
Join Date: Aug 2017
Posts: 4
That's wonderful.
Breenda is offline   Reply With Quote
Old 30th August 2017, 08:49   #498
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
thanks breenda... who would have thought the most active thread in the shoutcast section would be my twittercast script lol...
dopelabs is offline   Reply With Quote
Old 30th August 2017, 10:50   #499
Busby
Senior Member
 
Busby's Avatar
 
Join Date: Apr 2004
Location: Isle of Man UK
Posts: 120
Quote:
Originally Posted by dopelabs View Post
thanks breenda... who would have thought the most active thread in the shoutcast section would be my twittercast script lol...
It's fantastic that your work will help so many others who want to do the same with their radio stations..

I'll get there in the end...
www.1mix.co.uk
Busby is offline   Reply With Quote
Old 30th August 2017, 11:37   #500
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
im actually in the middle of re-writing the script to use the xml output of either v1 or 2. as it stands right now the script is simply parsing the text, using commas as the delimiter for each field.. the obvious problem here is if the track name has a comma in it, the title will only be up to the comma. it will truncate the rest.

so instead ill use the xml output which will resolve that issue.
dopelabs is offline   Reply With Quote
Old 1st September 2017, 13:32   #501
DJ-Garybaldy
Senior Member
 
DJ-Garybaldy's Avatar
 
Join Date: Sep 2003
Location: Manchester UK
Posts: 399
I'm now referring people to the Github downloads from my blog post about Twitter scripts for Shoutcast...

I know people who've been after a v2 script for a while now. I don't have a way to test this at present as I'm not streaming but its bound to be useful for those who need to test them.

Keep up the good work Dopelabs!



Proud user of RadioDJ FREE shoutcast automation software

Online: Twitter - Facebook - Mixcloud
DJ-Garybaldy is offline   Reply With Quote
Old 1st September 2017, 13:58   #502
dopelabs
Senior Member
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 493
Send a message via AIM to dopelabs
i use the same script. all my servers are either icecast or shoutcast v2... im actually combining the shout and ice scripts into a single script that will use the xml stats output since theres still a few issues when using 7.html on the shoutcast side.
dopelabs 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