日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
微信公眾平臺開發(fā)——在線點歌

    微信公眾平臺的消息接口-音樂消息,這是廣大微信公眾平臺開發(fā)者的福音。 根據(jù)這一功能,如果能做出在微信中點歌功能,那么我們以后就可以不用安裝其他APP, 直接在微信里面關注一個賬號,就可以聽歌了,還省去了安裝的麻煩,而且不用再占用空間。如果音樂資源足夠好,那將秒殺一切手機上在線聽歌軟件也不是沒有可能的。

成都創(chuàng)新互聯(lián)公司服務項目包括海安網(wǎng)站建設、海安網(wǎng)站制作、海安網(wǎng)頁制作以及海安網(wǎng)絡營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,海安網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務的客戶以成都為中心已經(jīng)輻射到海安省份的部分城市,未來相信會繼續(xù)擴大服務區(qū)域并繼續(xù)獲得客戶的支持與信任!

回復音樂消息




12345678


<![CDATA[TITLE]]>





參數(shù)是否必須說明
ToUserName接收方帳號(收到的OpenID)
FromUserName開發(fā)者微信號
CreateTime消息創(chuàng)建時間 (整型)
MsgTypemusic
Title音樂標題
Description音樂描述
MusicURL音樂鏈接
HQMusicUrl高質(zhì)量音樂鏈接,WIFI環(huán)境優(yōu)先使用該鏈接播放音樂
ThumbMediaId縮略圖的媒體id,通過上傳多媒體文件,得到的id

核心代碼:

    

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);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $data = curl_exec($ch);
                $content = array( "Title"=>"歌曲【".$this->name."】",
                        "Description"=>"檢索失敗",
                        "MusicUrl"=>"",
                        "HQMusicUrl"=>"");
                try{
                    @$menus = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
                    if ($menus->count > 0 && isset($menus->url[0]) && isset($menus->durl[0])){
                        $url_prefix = substr($menus->url[0]->encode,0,strripos($menus->url[0]->encode,'/') + 1);
                        $url_suffix = substr($menus->url[0]->decode,0,strripos($menus->url[0]->decode,'&'));
                        $durl_prefix = substr($menus->durl[0]->encode,0,strripos($menus->durl[0]->encode,'/') + 1);
                        $durl_suffix = substr($menus->durl[0]->decode,0,strripos($menus->durl[0]->decode,'&'));
                        if (strpos($this->name, "+")){
                            $content = array( "Title"=>$music[1],
                                    "Description"=>$music[0],
                                    "MusicUrl"=>$url_prefix.$url_suffix,
                                    "HQMusicUrl"=>$durl_prefix.$durl_suffix);
                        }else{
                            $content = array( "Title"=>$this->name,
                                    "Description"=>"百度音樂提供",
                                    "MusicUrl"=>$url_prefix.$url_suffix,
                                    "HQMusicUrl"=>$durl_prefix.$durl_suffix);
                        }
                    }
                }catch(Exception $e){
                }
            }
            return $content;
        }

接口調(diào)用:

include ('music.class.php');
$m = new MusicApi($musicContent);
$mArr = $m->getMusicInfo();
return $this->responseMusic($mArr["Title"], $mArr["Description"], $mArr["MusicUrl"], $mArr["HQMusicUrl"], 0);

效果演示:

微信公眾平臺開發(fā)——在線點歌

歡迎關注微信公眾號:音比特 微信號:yinbyte  或者用微信掃描下面二維碼來關注

微信公眾平臺開發(fā)——在線點歌


分享題目:微信公眾平臺開發(fā)——在線點歌
文章分享:http://www.dlmjj.cn/article/gsidss.html