Tunein.com api support

Read 133014 times
I think you would need to get someone to do this for you you would need a little php exp with this sorry
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
MyAutoDJ,

talking about the cron.php file, what are the parts that have to be be modified?
do the ' ' have to be kept? (for example, look at $ip = '23.23.23.23')

Code: [Select]
$ip = '23.23.23.23';
$port = '8000';  // server port
$password = 'PASSWORDHERE';  // server password
$type = 'SHOUTcast v2'; // choose  SHOUTcast v2  or  SHOUTcast v1  or    Icecast
$file = "/home/USERNAME/public_html/tunein/song.txt"; // make sure you have a song.txt text file and the path is correct, and that you set permissions to that file to 777

// TuneIn Radio Variables
$partnerID = 'partnerID';
$partnerKEY = 'partnerKEY';
$id = 'id';


(1) so sorry I forgot I had put a couple lines in there to hide php errors -- to turn error reporting on look for error_reporting(0); and delete that line

(2) yes the IP address, port number and password are for your SHOUTcast or Icecast server
the first part of the script checks the server type and will get the song title & artist
..the 2nd part writes the currently playing song to text file, and each minute as the cron runs it checks for a new song, if there is a new song it re-writes that song to the text file and also sends the notification to TuneIn, the song title and artist
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
another thing:

Code: [Select]
$ip = 'serverip';
$port = 'serverport';  // server port
$password = 'password';  // server password
$type = 'SHOUTcast v2'; // choose  SHOUTcast v2  or  SHOUTcast v1  or    Icecast
$file = "/home/USERNAME/public_html/tunein/song.txt"; // make sure you have a song.txt text file and the path is correct, and that you set permissions to that file to 777

do we have delete the lines (including the //) or can they be kept?
- // server port 
- // choose  SHOUTcast v2  or  SHOUTcast v1  or    Icecast
- // make sure you have a song.txt text file and the path is correct, and that you set permissions to that file
to 777

and the same applies to these lines, in the beginning of the script:

// Script by http://myautodj.com , if you like my script I ask you at least click on one of our Google ads on our site!
// This script will check when a new song plays and notify TuneIn radio. Requires API key from TuneIn http://tunein.com/broadcasters/api/
// TuneIn radio requires you do not send un nessary requests to them, this script will run on a cron job and only notify TuneIn radio when the song has changed.
// you must set up a cron job you can have it run as often as you like, 1 min does fine
// you should check and change the path to the text file -- you will need to change the path, depending on where you uploaded this file to -- if your using cPanel or other web hosting panel you should just be able to paste the entire line into your cron jobs (remember to change the path)
//    /usr/local/bin/php -q  /home/USERNAME/public_html/tunein/cron.php &> /dev/null

thanks.
Last Edit: August 16, 2013, 05:12:53 am by raoulduke881
(1) so sorry I forgot I had put a couple lines in there to hide php errors -- to turn error reporting on look for error_reporting(0); and delete that line

I've turned error_reporting(1) on through out but still no errors unfortunately...
+100
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>
-------------------
that works perfect on my server.

i have everything set up but like everyone else, its not writing to the txt file. When you try to visit the actual cron.php in a browser its 500 error i believe.

So what could the problem be? Because its not the server?
indiecore.net - playing everything that f**king rocks!
theycallmeruffi.com - my personal site
This is the error I'm getting trying to run the php script:

[14-Sep-2013 08:12:30] PHP Parse error:  syntax error, unexpected $end in /tunein/cron3.php on line 293

-----EDIT------

Okay so the reason its not working properly, some php tags were listed with <? instead of <?php

The short tag is deprecated and not supported in normal php.ini's.

So now its currently writing the song title to the txt file.

everything is up and running so far. I'm seeing titles on tunein. cronjob is working too.

cleaning up the code. but thanks again for this!
Last Edit: September 14, 2013, 12:51:09 am by ruffino
indiecore.net - playing everything that f**king rocks!
theycallmeruffi.com - my personal site
take that back. cron jobs will run, but its not writing anything to the txt file.

if i run the php script from a browser, it works just fine.
indiecore.net - playing everything that f**king rocks!
theycallmeruffi.com - my personal site
They you should try a different link for you cron then

try
lynx -dump http://website.com/path/to/cron.php &> /dev/null
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
With Ruffino's <?php fix and lynx -dump, this works for me now. Thanks all!
With Ruffino's <?php fix and lynx -dump, this works for me now. Thanks all!

glad we could get everything up and running! big thanks to autoDJ for writing it.
indiecore.net - playing everything that f**king rocks!
theycallmeruffi.com - my personal site
our server seem not to support that script (a port matter, we suppose)... still waiting for centova's news about this feature request!
Now the forum's been linked to the issue tracker. Please vote for this request if you approve...
Then provide us the link, thanks  8)

p.s: Steve, any info about this (several months old) request??