PageRenderTime 6ms CodeModel.GetById 0ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/#/actions/publish/ajax_audio.php

https://bitbucket.org/nemo_xiaolan/muyou
PHP | 19 lines | 15 code | 3 blank | 1 comment | 1 complexity | 4d5fae08be1c3a863798409944fb3d60 MD5 | raw file
 1<?php
 2
 3
 4if(!is_ajax()) {
 5    //r("home");
 6}
 7
 8$url = "http://www.xiami.com/widget/xml-single/uid/0/sid/".$_GET["songid"];
 9echo $url;exit;
10$data = file_get_contents($url);
11$data = simplexml_load_file($url);
12$data = array(
13    "song_id"    => (string)$data->track->song_id,
14    "song_name"  => (string)$data->track->song_name,
15    "album_name" => (string)$data->track->album_name,
16    "album_cover"=> (string)$data->track->album_cover,
17    "artist_name"=> (string)$data->track->artist_name
18);
19echo json_encode($data);