Created
August 11, 2018 09:10
-
-
Save vinyllicker/b0bccbf1919e5777171558ef9a1ae92e to your computer and use it in GitHub Desktop.
Generate Tracks and Artist from ACR Cloud stream monitoring using PHP
This file contains 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
//Read json and display title of track using php. This will print the item on your page. I use this in a shortcode via a shortcode plugin. | |
<?php | |
json_string = 'https://api.acrcloud.com/v1/monitor-streams/s-bVX73QK/results?access_key=4709cb1d4bf05a8e782034797xxxxxxx'; | |
$jsondata = file_get_contents($json_string); | |
$obj = json_decode($jsondata,true); | |
print_r($obj[0]['metadata']['music'][0]['title']); | |
?> | |
//Read json and display artist of track using php. This will print the item on your page. I use this in a shortcode via a shortcode plugin. | |
<?php | |
$json_string = 'https://api.acrcloud.com/v1/monitor-streams/s-bVX73QK/results?access_key=4709cb1d4bf05a8e782034797fxxxxxxx'; | |
$jsondata = file_get_contents($json_string); | |
$obj = json_decode($jsondata,true); | |
print_r($obj[0]['metadata']['music'][0]['artists'][0]['name']); | |
?> | |
//You can use these together easily across any standard PHP based site e.g., on a Wordpress site | |
//Explanation of string url | |
//https://api.acrcloud.com/v1/monitor-streams/ this is the standard stream url for monitoring | |
//s-bVX73QK/ this is the ARC Cloud stream id available from your ARC account once set up in the console | |
//results?access_key= enter this is to allow it to run the key in order to access the data | |
//4709cb1d4bf05a8e782034797fxxxxxx this is the key linked with the stream with the stream id above. | |
//The key can be found in the console under the Broadcast Monitring tab on the left in your ACR console | |
//You can see the results for our site being shown on our front page at https://fresh927.com.au |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment