标题: [原创] 用JS打开百度音乐盒听音乐 [打印本页]
作者: batman 时间: 2011-3-18 01:22 标题: 用JS打开百度音乐盒听音乐
以下代码是我根据网页源码改的,大家保存为*.html运行,权当好玩了。。。,- <html>
- <script type="text/javascript">
- songlist(10,'中文金曲榜',0);//可修改第二参数来选择你想要打开的榜单
- window.close();
- function songlist()
- {
- var site = "http://box.zhangmen.baidu.com/m?rf=idx&ct=134217728&tn=baidumt";
- var url = "";
- var p = function(k,v){
- return (v || v ==0) ? ("&"+k+"="+encodeURIComponent(v)): "";
- }
- var d = songlist.arguments;
- if(d.length!=0){
- if(d.length<3){
- url = site + "&gate=4"+p('id',d[0])+p('s_o',d[1]);
- }else{
- if(d[0]==10){
- url = site+"&gate=10&c_n=mp3order"+p("l_id",getLid(d[1]))+p("l_n",d[1])+p("s_o",d[2]);
- }else if(d[0] == 11){
- url = site+ "&gate=11&d_s=1&s_o=0&c_n=%E4%B8%93%E8%BE%91%E8%AF%95%E5%90%AC" + p("l_i",d[1])+p("a_n",d[2]);
- }else if(d[0] == 100){
- url = site+"&gate=10&c_n=mp3%E9%A6%96%E9%A1%B5&a_n=%E9%9A%8F%E4%BE%BF%E5%90%AC%E5%90%AC&s_n="+d[1]+p("s_o",d[2]);
- }
- }
- }else{
- url = site+"&gate=5";
- }
-
- var win = window.open(url, 'baidumb', 'width=870,height=650,top=0,left=0,scrollbars=0,resizable=0,status=1');
- win && win.focus();
- return false;
- }
- function getLid(list)
- {
- var map={"热门对唱":"103","歌曲TOP500":"3","新歌TOP100":"2","经典老歌":"102","中文金曲榜":"1","影视金曲":"100","摇滚歌曲榜":"110","轻音乐":"5","欧美金曲":"112","日韩流行风":"113","流金岁月":"107","相声曲艺":"6","dj舞曲":"4","少儿歌曲":"7","校园民谣":"106","中国民乐":"8","分类试听dj":"17","":""};
- return map[list];
- }
- </script>
- </html>
复制代码
作者: vbscxf 时间: 2012-2-19 20:10
打开就是杨幂唱的歌,实在唱得难听!!
作者: cjiabing 时间: 2012-2-19 21:10
我弄了个百度版的
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |