Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

50 users online



Shoutcast Script?? Can Any One help...

Shoutcast Script?? Can Any One help...

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 2
eskiehax

eskiehax

Neverside Newbie
Status: Offline!

Shoutcast Script?? Can Any One help...

Is ther such script that tells you if your radio station is online or offline??? Please reply if there is i've tried looking but no luck... thanks

___________________

:: Feed The EsK!e Inside ::

BigToach

BigToach

Neversidian
Status: Offline!

fsockopen("ip",port

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

eskiehax

eskiehax

Neverside Newbie
Status: Offline!

what does that do & where do i put that lol

___________________

:: Feed The EsK!e Inside ::

damell

damell

Status: Offline!

find the ip or url of the radio station and the port, then use as so:

PHP:

<?php

$check 
fsockopen("www.radiostation.com" 80);

if(!
$check) {
offline
} else {
online
}

?>

___________________

//damell

eskiehax

eskiehax

Neverside Newbie
Status: Offline!

ok im very Crappy with PHP , can it be done any easier??

___________________

:: Feed The EsK!e Inside ::

damell

damell

Status: Offline!

how the hell is 5 lines of code difficult, stick the url in and 80 for the port, and voila.

___________________

//damell

Last edited by damell, April 27th, 2003 07:12 PM (Edited 1 times)

BigToach

BigToach

Neversidian
Status: Offline!

ok here you go. just change the images and it will work and the ip and port.

PHP:


<?php
$check 
= @fsockopen ("127.0.0.1"80,$errno$errstr,1); // change 127.0.0.1 to your shoucast ip and 80 to the port 
if($check) {    
    
header('content-type: image/gif');
    
readfile('aimon.gif'); // change this to an image you want when shoutcast is on
} else {    
    
header('content-type: image/gif');
    
readfile('aimoff.gif'); // change this to an image you want when shoutcast is off

}
?>


save this script to its own file dont modify it other than what i said. just save it as onlinestatus.php then use it just like an image. <img src='onlinestatus.php'>

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

damell

damell

Status: Offline!

that looks too difficult bigtoach, isn't there an easier way to do it?

Roll Eyes

___________________

//damell

BigToach

BigToach

Neversidian
Status: Offline!

thats the same exact thing as your code just using an image instead. only real difference is that mine wont take 30 to timeout. it takes max of 1 second.
here you can do this if you just want plain text.

PHP:


<?php
$check 
= @fsockopen ("127.0.0.1"80,$errno$errstr,1);
if(
$check) {    
    echo 
'online';
} else {    
    echo 
'offline';
}
?>

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

damell

damell

Status: Offline!

QUOTE BY eskiehax
ok im very Crappy with PHP , can it be done any easier??

note the rolleyes in my post, i was being sarcastic, of course i understand it Shocked

___________________

//damell

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0187 seconds.