文档库 最新最全的文档下载
当前位置:文档库 › 公务员网络培训听课代码-河南

公务员网络培训听课代码-河南

var doPostHack = function(_userId, _courseId, _from_index, _end_index){
var _url = "https://www.wendangku.net/doc/cf13447915.html,:80/play/AICCProgressNew.ashx";
// var _userId = "410725************";
// var _courseId = 2712;
// var _sid = "S002";
var _movie_len = 1;

var doPostSid = function(index){
if(index > _end_index) {
alert("这可不对哦,又偷懒了,ll。");
return;
}
var _sid = _getSidStr(index);

var _start_time = new Date();
var _end_time = new Date();
_end_time.setTime(_start_time.getTime() + _movie_len * 1000);

var _date_format = "yyyy-MM-dd hh:mm:ss";
_start_time = _start_time.format(_date_format);
_end_time = _end_time.format(_date_format);

$.post(_url,{
method:"setParam",
lastLocation:"0",
SID:_sid,
curtime:_start_time,
STime:_movie_len,
state:"S",
courseID:_courseId,
userID:_userId
},function(){
setTimeout(function(){
$.post(_url,{
method:"setParam",
lastLocation:_movie_len,
SID:_sid,
curtime:_end_time,
STime:_movie_len,
state:"C",
courseID:_courseId,
userID:_userId
},function(){
console.log(_courseId + ":" + _sid + " Over!");
setTimeout(function(){
doPostSid(index + 1);
}, 4000);
});
}, 2000);
});
}
doPostSid(_from_index);
}

var _getSidStr = function(index){
var s = index + "";
var s0 = "";
for(var i=0;i<(3 - s.length);i++){
s0 += "0";
}
return "S" + s0 + index;
}
Date.prototype.format =function(format){
var o = {
"M+" : this.getMonth()+1,
"d+" : this.getDate(),
"h+" : this.getHours(),
"m+" : this.getMinutes(),
"s+" : this.getSeconds(),
"q+" : Math.floor((this.getMonth()+3)/3),
"S" : this.getMilliseconds()
}
if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
(this.getFullYear()+"").substr(4- RegExp.$1.length));
for(var k in o)if(new RegExp("("+ k +")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length==1? o[k] :
("00"+ o[k]).substr((""+ o[k]).length));
return format;
}

doPostHack("411111111111111111",2076,1,56);

相关文档
相关文档 最新文档