Skip to content

Instantly share code, notes, and snippets.

@oott123
Created August 14, 2013 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oott123/6228994 to your computer and use it in GitHub Desktop.
Save oott123/6228994 to your computer and use it in GitHub Desktop.
ptbus 自动领卡脚本
var cardid,intid;
function getcard(){
jQuery.get('http://bbs.ptbus.com/plugin.php?id=gamecard:apply&typeid='+cardid+'&actiontype=1&infloat=yes&handlekey=lin&inajax=1',(function(data){
var a = jQuery(jQuery(data).text()).find('.alert_error').text();
data = '<div>'+jQuery(data).text();
var b = jQuery(data).find('.f1').text();
var c = jQuery(data).find('.f5').text();
if(a){
console.log(a);
}else{
clearInterval(intid);
alert(b+"\n"+c);
}
}));
}
cardid = prompt();
intid = setInterval("getcard()",500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment