刷网课访问量

最近期末,要刷一门课的线上访问次数。,这个东西很扯,很多人就是纯手工把访问次数刷到了300

我试了很多次,想弄清楚超星学习通的访问次数到底是怎么计算的,写了几个脚本,没有成功

然后换了个思路,弄了一段js放在控制台里,实现自动刷新。我发现刷新课程首页的时候有时候会加访问次数(随缘加,现在应该是有成效了,所以分享一下

var timeout = prompt("设置刷新时间间隔[S]");  
// 获取当前的URL  
var current = location.href;  

if(timeout > 0)  
{  
    // 时间间隔大于0,timeout秒之后执行reload函数  
    setTimeout('reload()', 1000 * timeout);  
}  
else  
{  
    // 时间间隔不大于0,仅刷新一次  
    location.replace(current);  
}  

function reload()  
{  
    // timeout秒后执行reload函数,实现无限循环刷新  
    setTimeout('reload()', 1000 * timeout);  
    // 下面两行代码的格式化后的内容为:  
    // <frameset cols='*'>  
    //     <frame src='当前地址栏的URL' />  
    // </frameset>  
    var fr4me = '<frameset cols=\'*\'>\n<frame src=\'' + current + '\' />';  
    fr4me += '</frameset>';  

    with(document)  
    {  
        // 引用document对象,调用write方法写入框架,打开新窗口  
        write(fr4me);  
        // 关闭上面的窗口  
        void(close());  
    };  
}

转载于:https://www.cnblogs.com/QuixoteY/p/10984938.html

猜你喜欢

转载自blog.csdn.net/weixin_34357962/article/details/93369488