That's a good start and there are a lot of options as John says.
One thing I can add is that to use file_get_contents(), or really any functions that would do the same thing, you need to set your server to allow external URLs. If that parameter is disabled it will only work for local files. If you have problems with it, check this. If it works, then your server is already configured to handle it.
The parameter is called allow_url_fopen. There might be some more ways to configure all of it, but generally speaking that should be enough info for now.
Also, I want to give you some more advice about the nature of your request: while your purposes may be entirely legal, the methods you are using could be potentially against the terms of service for the website. While I don't personally care that much what you do, the station from which you are taking this data certainly will. They probably want to protect this data just as much as you want to keep it. The way that this might become an issue is that you aren't "listening to the radio" but instead are automating a process in an unusual way. It is normal to listen to the radio. It is not normal to create an automated script that just checks the playlist and skips actually listening to the music. This means that your behavior (rather, your server's behavior) may get flagged by their server as an automated request and they may block you. This entirely depends on how obvious it is (that the behavior of your server is different from a regular visitor) and how aware they are of the activity on the server. Furthermore, they could even just check that the IP of the request is the same as a server and therefore is probably an automated request, rather than an IP without a website attached to it-- probably a regular user.
Do what you'd like, but be aware that the legal situation is complex, not just in what you do, but also how you do it. And regardless of legality, a host can block you if they feel like it, and if that happens there's nothing you can do about it (as far as I know, there are no legal rights associated with being able to access a domain).
Of course one simple option for all of this is to just ask them to work with you, letting you have access to their playlists (either through this method or another) and perhaps you could trade. They might say no, but in that case at least you'd know for sure that you aren't going to randomly get blocked, or even sued (you don't need to be anything illegal to get sued, just to be proven guilty). I imagine that without asking for permission this could eventually lead to a cease and desist letter which basically means "stop or we'll try something else". At that point, of course, you could look for another solution, but getting their cooperation beyond that is unlikely, I'd guess.



Reply With Quote


Bookmarks