FWQ
微信公众平台开发在线点歌功能介绍
微信公众平台的消息接口-音乐消息,这是广大微信公众平台开发者的福音。 根据这一功能,如果能做出在微信中点歌功能,那么我们以后就可以不用安装其他app, 直接在微信里面关注一个账号,就可以听歌了,还省去了安装的麻烦,而且不用再占用空间。如果音乐资源足够好,那将秒杀一切手机上在线听歌软件也不是没有可能的。 回复音乐消息 <xml><tousername></tousername><fromusername></fromusername><createtime>12345678</createtime><msgtype></msgtype><music><title></title> <description></description><musicurl></musicurl><hqmusicurl></hqmusicurl><thumbmediaid></thumbmediaid></music></xml> 登录后复制 核心代码: public function getMusicInfo() { if ($this->name == ""){ $content = array( "Title"=>"", "Description"=>"你还没告诉我音乐名称呢?", "MusicUrl"=>"", "HQMusicUrl"=>""); } else { if (strpos($this->name, "+")){ $music = explode("+",$this->name); $url = "http://box.zhangmen.baidu.com/x?op=12&count=1&title=".$music[1]."$$".$music[0]."$$$$"; }else{ $url = "http://box.zhangmen.baidu.com/x?op=12&count=1&title=".$this->name."$$"; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url);…