免费接口

来源:互联网 发布:马刺雷霆季后赛数据 编辑:程序博客网 时间:2024/04/27 15:29
天气接口


气象局接口:
http://m.weather.com.cn/data/101010100.html       《 json》
音乐接口


虾米接口
http://kuang.xiami.com/app/nineteen/search/key/歌曲名称/diandian/1/page/歌曲当前页?_=当前毫秒&callback=getXiamiData
QQ空间收藏音乐接口
http://qzone-music.qq.com/fcg-bin/fcg_music_fav_getinfo.fcg?dirinfo=0&dirid=1&uin=QQ号&p=0.519638272547262&g_tk=1284234856
IP接口


新浪接口(ip值为空的时候 获取本地的)
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=218.4.255.255
淘宝接口
http://ip.taobao.com/service/getIpInfo.php?ip=63.223.108.42
手机信息查询接口


淘宝网接口
http://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel=手机号
拍拍接口
http://virtual.paipai.com/extinfo/GetMobileProductInfo?mobile=手机号&amount=10000&callname=getPhoneNumInfoExtCallback
百付宝接口
https://www.baifubao.com/callback?cmd=1059&callback=phone&phone=手机号
115接口
http://cz.115.com/?ct=index&ac=get_mobile_local&callback=jsonp1333962541001&mobile=手机号
有道接口
http://www.youdao.com/smartresult-xml/search.s?jsFlag=true&type=mobile&q=手机号
视频信息接口


优酷
http://v.youku.com/player/getPlayList/VideoIDS/视频ID (比如 http://v.youku.com/v_show/id_XNTQxNzc4ODg0.html的ID就是XNTQxNzc4ODg0)
翻译、词典接口


腾讯

http://dict.qq.com/dict?q=词语


微信音乐功能实现(运用百度音乐)

private function findMusic($data,$msg){$cache = memcachex::getMemCache();if(!preg_match("/[^\d-., ]/",$data)){$result = $cache->get($msg->getFromUsername().'_music');$index=intval($data,10);if($result!= null && isset($result[$index])){$link1=$result[$index-1];$link2='http://music.baidu.com/'.$link1.'/download';//echo $link2;$html2=file_get_html($link2);$download=$html2->getElementById('bit128');$url1=$download->downlink;//获得想要的链接//$download2=$html2->getElementById('bit192');//$url2=$download2->downlink;//获得想要的链接 $title=$html2->find('span[class=fwb]',0)->plaintext;//获得歌名$title = trim($title);$author=$html2->find('span[class=author_list]',0)->plaintext;//获得歌手$author = trim($author);$music=array('Title'=>$title,'Description'=>$author,'MusicUrl'=>substr($url1,22),'HQMusicUrl'=>substr($url1,22),);return new back($msg->getToUsername(),$msg->getFromUsername(),$music,"music", $msg->getCreateTime(),0);}}$qurl='http://music.baidu.com/search?key='.$data;//搜索链接$html1=file_get_html($qurl);$i=0;$music = array();$content = "没有找到歌曲,可能不是歌名或者检索失败,请换首歌试试!";foreach($html1->find('li[class=bb-dotimg clearfix song-item-hook]') as $stitle){ $urlx = $stitle->find('span[class=song-title]',0);//获得想要的链接$link1=$urlx->first_child ()->href;$title=$urlx->first_child ()->title;//获得歌名$title = trim($title);$authorx=$stitle->find('span[class=author_list]',0);$author=$authorx->title;//获得歌手$author = trim($author);$music[$i++]=$link1;if($i==1){$content = "回复数字序号立即听歌!\n".$i."、".$title."[".$author."]\n";}else{$content = $content.$i."、".$title."[".$author."]\n";}if($i==10){break;}}writeMemcache($cache, $music,$msg->getFromUsername().'_music');return new back($msg->getToUsername(),$msg->getFromUsername(),$content,"text", $msg->getCreateTime(),0);}