done.js
$(document).ready(function() { $("body").append("");/*取随机数函数*/$.rand=function(Min,Max){ var Range = Max - Min; var Rand = Math.random(); return(Min + Math.round(Rand * Range)); };/*自动执行的*/ (function() { $("#boy").slideDown(); if (window.location.href.indexOf('tieba.baidu.com/p/') > 0) { var times = $(".j_lzl_wrapper>.core_reply_tail>ul.p_tail>li:nth-child(2)").text(); var time = times.substr(0, 16) + ':00'; var a = time.split(" "); var b = a[0].split("-"); var c = a[1].split(":"); var date = new Date(); date.setFullYear(b[0],parseInt(b[1].replace("0",""))-1,b[2]); date.setHours(c[0],c[1],c[2]); var now = new Date(); var dateCha = now - date; var dateChaDays = Math.floor(dateCha / (24 * 3600 * 1000)); if (dateChaDays > 120) { $(".new_tiezi_tip").before("酷小子贴吧工具工具更新附加功能wap签到(beta)查询水度坟贴提醒小尾巴儿页面改造器酷小子工具·坟帖提醒:该帖子发表于" + dateChaDays + "天以前,挖坟需谨慎") } /*如果在帖子页面,新增功能*/ $("#boy").append("插入糗事"); $("#boy").append("强刷回复"); $("#boy").append("狂刷回复(神器)"); } /*小尾巴*/ if (localStorage["boyWeiba"]) { $(".tb-editor-editarea").append("" + localStorage["boyWeiba"].replace("?.png","?"+Math.random()+"&.png") + "") } })();/*自动执行的*/ $("#boy-test").on("click", function() { window.open('chrome-extension:///t.html'); }); $(".boy-list").on("mouseenter", function() { $(this).animate({ marginLeft: '10px' }, 'fast') }); $(".boy-list").on("mouseleave", function() { $(this).animate({ marginLeft: '0px' }, 'fast') }); $('#boy').on("mouseenter", function() { $(this).animate({ opacity: '0.6', left:"0" }, "fast") }); $('#boy').on("mouseleave", function() { $(this).animate({ opacity: '0.2', left:"-100" }, "fast") }); $("#boy_update").on("click", function() { window.location = 'http://www.44886.com/forum.php?mod=viewthread&tid=37&page=1#pid37'; }); $("#boy_other").on("click", function() { $.dialog({ id:'boy-other-content', title:'酷小子附加娱乐中心', width:642, height:482, min:false, max:false, fixed:true, content:'url:http://tieba.44886.com', zIndex:999999 }); }); /*下面功能是老版本的一键签到,v2.0被取消掉*/ /* $("#boy_sign").on("click", function() { $.dialog({ id: 'alert', content: '提示:使用本功能,您当前查看的页面将会跳转到签到界面,签到完成后请按下F5返回您当前正在查看的页面。', title: '提醒您', width: 340, min: false, max: false, fixed: true, button: [{ name: '立即签到', callback: function() { void((function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.charset = 'UTF-8'; e.src = 'http://kutools.duapp.com/baidu.js'; document.body.appendChild(e); })()) }, focus: true }, { name: '算了', }, ] }) }); */ /*狂刷回复功能*/ var reply_txt='酷小子贴吧工具'; var reply_txt_array=null; var tid=0; var reply_num=0;/*第几次回复了*/ var reply_ba_name='';/*贴吧名称*/ var reply_tbs='';/*tbs*/ var reply_timer = null; $.reply = function() { reply_num++; $.ajax({ url: "http://wapp.baidu.com/mo/q---wapp_1370150224473_797--1-1-0--2/m", dataType: "text", type:'POST', data:"ti=回复&src=1&word="+reply_ba_name+"&tbs="+reply_tbs+"&ifpost=1&ifposta=1&post_info=0&tn=baiduWiseSubmit&fid=2084826&verify=&verify_2=&pinf=1_2_0&pic_info=&z="+tid+"&last=0&pn=0&r=0&see_lz=0&no_post_pic=0&floor=&sub1=回贴&co="+reply_txt_array[$.rand(0,(reply_txt_array.length)-1 )]+"", success: function(msg) { if(msg.indexOf('回贴成功')>0){ $("#boy_reply_content").prepend("+第"+reply_num+"次--刷回复成功--1秒后继续"); setTimeout($.reply,1000); }else if(msg.indexOf('您的操作过于频繁,请稍后再试')>0){ $("#boy_reply_content").prepend("+第"+reply_num+"次--操作过于频繁,失败,休息1分钟再工作"); setTimeout($.reply,60000); }else{ $("#boy_reply_content").prepend("+第"+reply_num+"次--失败--2秒后再试"); setTimeout($.reply,2000); } }, }) } $("#boy-reply").on("click", function() { $.dialog({ id: 'alert', content: '提示:本功能为v1.7版新增,能够让你看到刷帖的过程,而且在你主动停止之前,不会停止刷帖。', title: '提醒您', width: 340, min: false, max: false, fixed: true, button: [{ name: '立即刷', callback: function() { $("body").append(" "); $("#boy_reply_content").append("请输入你想刷的内容:"); $("#boy_reply_content").append(''); $("#boy_reply_content").append(''); $("#boy_reply_but").click(function(){ /*获取当前帖子的ID*/ tid=window.location.href.replace("http://tieba.baidu.com/p/",""); /*获取完毕*/ $.ajax({ url:"http://wapp.baidu.com/mo/q---wapp_1370150224473_797--1-1-0--2/m?kz="+tid+"&is_bakan=0&lp=5010&pinf=1_2_0", dataType:"text", beforeSend: function(){ reply_txt=$("#boy_reply_txt").val(); reply_txt_array=reply_txt.split("\n"); $("#boy_reply_content").html(''); $("#boy_reply_content").html('狂刷回复,开始了!请不要刷新页面,不要关闭窗口。坐等任务消息。如果想退出,请刷新页面!'); }, success: function(msg){ var re=/name="tbs" value=".*?"/i; var result=msg.match(re); if(result!=null){ reply_tbs=result[0].replace('name="tbs" value="',''); reply_tbs=reply_tbs.replace('"',''); reply_ba_name= $("#wd1").val(); $.reply(); }else{ $("#sgin_wap").prepend("失败,没获取到临时码,请刷新页面"); } } }); }); }, focus: true }, { name: '算了', }, ] }) }); /*狂刷回复*/ /*下面代码是WAP签到*/ var ba_num = 0; var bas = null; var sgin_num = 0; var sgin_timer = null; $.sgin_wap = function() { if (sgin_num >= ba_num) { $("#sgin_wap").prepend("恭喜你,签到全部完成!请手动刷新页面"); return false; } ba = bas[sgin_num]; ba = ba.replace('+" + (sgin_num + 1) + '.' + decodeURI(ba) + '--'); }, dataType: "text", success: function(msg) { if (msg.indexOf('已签到') > 0) { $("#sgin" + sgin_num + "").append("已经签到了--3秒后继续"); sgin_num++; setTimeout($.sgin_wap,3000); return false } else { re = /本吧没开放签到功能--3秒后继续"); sgin_num++; setTimeout($.sgin_wap,3000); } else { url = result[0].replace('还没签到--马上签到--"); $.ajax({ url: "http://wapp.baidu.com" + url, dataType: "text", success: function(msg) { if (msg.indexOf('签到成功') > 0) { $("#sgin" + sgin_num + "").append("签到成功--休息5秒"); } else { $("#sgin" + sgin_num + "").append("签到失败(请人工进该贴吧看看)--休息5秒"); } sgin_num++; setTimeout($.sgin_wap,5000); return false } }) } } }, }) } $("#boy_sign_wap").on("click", function() { $.dialog({ id: 'alert', content: '提示:模拟WAP一键签到,每天5点经验,测试版。', title: '提醒您', width: 340, min: false, max: false, fixed: true, button: [{ name: '立即签到', callback: function() { $("body").append(" "); $.ajax({ url: "http://tieba.baidu.com/mo/q-0--9DA45AC5AEA644802A9EB085E2F49C2F-sz%40224_220%2C-1-1-0--/m?tn=bdFBW&tab=favorite", dataType: "text", beforeSend: function() { $("#sgin_wap").prepend("嗯哼,我开始工作了。请稍后,我会把签到的情况写出来的,注意新的消息在上面哦~~签到过程,不要刷新页面!任何问题,请在贴吧 @风云酷小子") }, success: function(msg) { var re = /
- '; for (var i in msg) { txt += "
- " + msg[i]['text'] + "" if(msg[i]["img"]!=undefined){ txt +=''; } txt += " "; } txt += "