Created
December 19, 2016 08:19
-
-
Save pkorpine/d2c2a0dd32c0482fe003ab9bfbf824a0 to your computer and use it in GitHub Desktop.
Redirect to Radio Rock's mp3 stream (which url keeps changing)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://www.radiorock.fi/api/content?tagCategory=info&page=0'; | |
$data = file_get_contents($url); | |
preg_match('/http:\/\/icelive.*?mp3/', $data, $m); | |
$stream_url = $m[0]; | |
header("Location: $stream_url"); | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link to live demo