Tunein.com api support

Read 133021 times
SOrry I only use Centos but if it's not writing anything to your text file, and permissions are correct try testing fwrite on your server

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>

http://www.w3schools.com/php/func_filesystem_fwrite.asp
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
i'm just a normal user and i don't have the necessary knowledge and the administrative credentials to modify the server where our station is located: i am only allowed yo upload music / switch to live broadcasting /modify minor settings on my station.
Thanks to the user "MY auto Dj" for posting that script but i (like tens of other users here in this forum) need a more simple way to integrate tunein.com api script on centova's client control panel...
Last Edit: August 14, 2013, 09:42:33 am by raoulduke881
raoulduke881 it should not be that hard, do you have a web hosting account (cPanel would be easiest) you can use?

More or less you just upload the entire tunein folder to your web hosting (ie. public_html/tunein/), set the permissions to the song.txt folder to 777 (in FileZilla just right click the song.txt file and look for "file permissions")

in cPanel you will create a cron job, see this screenshot -- (if you tell me what you use for your web hosting I can help you choose the correct path you will need, the path included in the screenshot will not work)

http://prntscr.com/1l8kic

also there is no reason this cannot run on a Centova v3 server I wouldn't think

-------------------------------------------------------------------------------------------------------
We offer unlimited bandwidth with all our packages, there is no way  I would ever enable it in Centova if it were a option, iTunes radio is nothing compared to the amount of listeners you'll get with Tune In radio, when you display the currently playing song in your Tune In directory your going to get lots of listeners fast!
 The more listeners the more server resources you use, and I think one of the main reason for buffering, if every stream on your server gets 100 listeners steady your not going to be able to run as many streams and make a lot less money.

On the other hand, if your a provider and charge clients by bandwidth then this option would in fact be ideal, as your client grows they pay more and more -- so I agree a Tune In add on to Centova would be great, I would start offering different packages with metered bandwidth and unlimited listeners, as well as lots of marketing ideas.

 
Last Edit: August 14, 2013, 10:53:11 am by My Auto DJ
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
SOrry I only use Centos but if it's not writing anything to your text file, and permissions are correct try testing fwrite on your server

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>

http://www.w3schools.com/php/func_filesystem_fwrite.asp

That doesn't work for me I'm afraid. Is there something I can do about it? Thanks!
I guess you just do not have the access, you could ask your web host about it.
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
I run my own dedicated host so I have full access...
Then you should be able to use the command fwrite it's a very common command, as your dedicated provider for help. Do you get a error when you try to run the sample?
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
It outputs '21' to the CLI. That's it.
Are you even able to run php scripts on your server?
If unsure try running <?php echo 'test'; ?>
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
Are you even able to run php scripts on your server?
If unsure try running <?php echo 'test'; ?>

Of course I am and that worked by the way...
Then you should be able to us fwrte, most likely your not using the correct path, you can't use test.txt you must use something like /home/user/public_html/path_to_/test.htm -- did you follow the instructions in the cron.php file, I'm betting  you just left that part un-changed??

If not you should ask your dedicated provider why it does not work if your not able to figure out why, or use Google to troubleshoot  https://www.google.com/search?q=can't+use+fwrite
Last Edit: August 15, 2013, 04:21:21 am by My Auto DJ
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
raoulduke881 it should not be that hard, do you have a web hosting account (cPanel would be easiest) you can use?

More or less you just upload the entire tunein folder to your web hosting (ie. public_html/tunein/), set the permissions to the song.txt folder to 777 (in FileZilla just right click the song.txt file and look for "file permissions")

in cPanel you will create a cron job, see this screenshot -- (if you tell me what you use for your web hosting I can help you choose the correct path you will need, the path included in the screenshot will not work)

http://prntscr.com/1l8kic

also there is no reason this cannot run on a Centova v3 server I wouldn't think


i've contacted our webmaster and sent him the script you made, let's see if something can be done. the idea is to run the script from the server that hosts our station's webpage (server that is different and separated from the one used to stream)

We offer unlimited bandwidth with all our packages, there is no way  I would ever enable it in Centova if it were a option, iTunes radio is nothing compared to the amount of listeners you'll get with Tune In radio, when you display the currently playing song in your Tune In directory your going to get lots of listeners fast!
 The more listeners the more server resources you use, and I think one of the main reason for buffering, if every stream on your server gets 100 listeners steady your not going to be able to run as many streams and make a lot less money.

On the other hand, if your a provider and charge clients by bandwidth then this option would in fact be ideal, as your client grows they pay more and more -- so I agree a Tune In add on to Centova would be great, I would start offering different packages with metered bandwidth and unlimited listeners, as well as lots of marketing ideas.

 

our station has a maximum of 400 simultaneous listeners with a max bitrate of 128kbit (we stick to 96), but this limit will be ever far from be reached. bandwidth should not be a problem for us.
Last Edit: August 15, 2013, 05:40:27 am by raoulduke881
Then you should be able to us fwrte, most likely your not using the correct path, you can't use test.txt you must use something like /home/user/public_html/path_to_/test.htm -- did you follow the instructions in the cron.php file, I'm betting  you just left that part un-changed??

If not you should ask your dedicated provider why it does not work if your not able to figure out why, or use Google to troubleshoot  https://www.google.com/search?q=can't+use+fwrite

So the test file worked when I edited the path but cron.php still doesn't. Any thoughts on how to debug the problem? I've tried running php interactively and checking the syntax but that didn't give me anything...
Sorry I do not know without a error message or something, are you saying it works when you run it in your browser and refresh, or are you saying that does not work either -- with a simple "it doesn't work" I really don't know sorry
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
What I'm saying is this script worked when I changed the path:

<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>

But the tunein script doesn't. There's no output at the CLI baring some blank lines and nothing in my php error log file. Anyway if you could tell me how to generate error message I will report back...