getvcount.js

来自「最强的爬虫工程」· JavaScript 代码 · 共 3 行

JS
3
字号

var getVCount={strQuery:"",hasRequest:false,extendBase:function(){if(this.hasExtendBase){return true;}if(typeof(hasInitBaseObject)=='undefined'||false==hasInitBaseObject){document.writeln('<scr'+'ipt type="text/javascript" src="http://you.video.sina.com.cn/js/baseOperate/baseObject.js"></scr'+'ipt>');hasInitBaseObject=true;}if(typeof(baseObject)=='undefined'){var me=this;setTimeout(function(){me.extendBase();},100);return false;}var B=baseObject;for(var p in B){var P=this[p];if(B.isNull(P)){this[p]=B[p];}}this.hasExtendBase=true;},getParam:function(){this.strQuery='';var divs=document.getElementsByTagName('SPAN');for(i=0;i<divs.length;i++){if(""!=divs[i].getAttribute('showVCount')&&null!=divs[i].getAttribute('showVCount')){this.strQuery+=divs[i].getAttribute('showVCount')+"x";}}},getCount:function(){if(typeof(baseObject)=='undefined'){var me=this;setTimeout(function(){me.getCount();},100);return false;}else{this.extendBase();}this.getParam();var postUrl="http://interface.video.sina.com.cn/app/count/getFlashCount.php?vid="+this.strQuery+"&action=flash";if(""!=this.strQuery){count=false;me=this;this.requestJs(postUrl,'count',function(temJsonData){me.show(temJsonData);});}},show:function(count){if(""!=this.strQuery){if(typeof(count)!="undefined"&&count!=false){this.showCount(count);}}},showCount:function(count){var obj=eval(count);var divs=document.getElementsByTagName('SPAN');for(i=0;i<divs.length;i++){if(""!=divs[i].getAttribute('showVCount')&&null!=divs[i].getAttribute('showVCount')){var key=divs[i].getAttribute('showVCount').split('-');divs[i].innerHTML=obj[key[0]];}}}};getVCount.extendBase();function getVCountShowProcess(){getVCount.getCount();}getVCount.getCount();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?