Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieving SHOUTcast Station Lists with PHP

    I am currently developing a website that is going to need to grab a list of the shoutcast stations, including name, description, genre, currently playing song, # listeners, bitrate and ip & port!

    I have seen many programs that do this, but can't seem to find any instructions on how to do it with any webscripting languages.

    The site is going to use alot of javascript and very few full page reloads, so I'm not going to be using tons of php, however I think it'd be good for getting the station information and mabye dynamically generating xml files with all the server information in it, which can then be used by the javascript.

    Please help if you can!

    Thanks

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    If the website puts out an rss feed, just use that and grap magpie to read it. If no rss feed is available, use file_get_contents and write a function to filter out what you need. Prolly have to do that for each site as all sites are different. But if there playlists, they should provide some type of feed?

  • #3
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Those are both good ideas, i thought of them too

    However, they have no RSS feed and I haven't found any other sites besides Shoutcast.com that have a full list of all stations, and besides that, I can't get the full list since I can only view 20 stations at a time on one page (900 something pages total). So file_get_contents would have to be done multiple times, however It would be a possibility. Although this would not be my prefered way, I could have my team manually go through and write the xml by hand and then just have the code check it for broken links, and we'd update them as necessary, since we're probably not going to have ALL the stations.

    Actually, as i'm writing this I think I have an idea. Since we're mostly going for bigger stations I could file_get_contents on their page if i sort it by popularity, i could grab the first two pages for each genre. That'd still take more code that I want, but it'd work.

  • #4
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Na grab it all, filter it, put it in your database, then create the xml from that. Do it one time. Then put in some error checking for broken links and additions and have everything automated . I love automation!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •