[源码]随机获取虾米音乐song_id API文件
January 11, 2015
- <?php
- $url = file_get_contents('http://www.xiami.com/search/song/page/'.rand(1,636).'?key=%E5%8A%A8%E6%BC%AB&is_pub=y');
- preg_match_all("/\?sid=(\d+)/", $url, $song);
- if($_GET){
- echo $_GET['callback'].'('.json_encode(array("song_id"=>$song[1][rand(0,19)])).')';
- }else{
- echo json_encode(array("song_id"=>$song[1][rand(0,19)]));
- }