1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
|
(function () { 'use strict';
var list=["Cortana","今日百色","易锦教育","易锦大学","CUIT网络空间安全学院","丁凌娜","黄恋茹","Victor","墙"]; function getFirstTime(){ var first=jQuery(".f-single").eq(0); var timetime = first.find(".info-detail .ui-mr8.state").html(); console.log(timetime); } function matchList(nickName){ var match = false; for(i=0;i<list.length;i++){ if(nickName.indexOf(list[i])>-1){ match=true; break; } } return match; } function faded(first){ getFirstTime(); first.slideUp(100,function(){this.remove()}); } function clearLiked(){ jQuery("#finishedClearLiked").html("pending."); var first=jQuery(".f-single").eq(0); console.log(first); if(first.length==0){ jQuery("#finishedClearLiked").html("finished."); return; } var nickName1 = first.find(".f-nick a").html(); console.log(nickName1); var match1 = matchList(nickName1); if(match1==true){ console.log("进入{pass}分支"); var second=jQuery(".f-single").eq(1); var nextZan=second.find("a.qz_like_btn_v3[data-clicklog='cancellike']"); console.log("第二个人有无取消赞:",nextZan.length); if(nextZan.length!=0){ console.log("下面有取消赞,所以pass"); first.remove(); setTimeout(clearLiked,125); } else{ console.log("第二个人下面无取消赞,"); var nickName2 = second.find(".f-nick a").html(); console.log("第二个人:",nickName2); var match2 = matchList(nickName2); if(match2==true){ console.log("进入{pass}分支"); var third=jQuery(".f-single").eq(2); var nickName3 = second.find(".f-nick a").html(); console.log("第三个人:",nickName3); var thirdZan=third.find("a.qz_like_btn_v3[data-clicklog='cancellike']"); console.log("第三个人有无取消赞:",thirdZan.length); if(thirdZan.length!=0){ console.log("第三个人下面有取消赞,所以pass"); first.remove(); setTimeout(clearLiked,125); } else{ console.log("下面无取消赞,所以停止"); jQuery("#finishedClearLiked").html("finished."); } } } } else{ var zan=first.find("a.qz_like_btn_v3[data-clicklog='like']"); console.log("第一个人有无点赞按钮:",zan.length); if(zan.length!=0){ jQuery("#finishedClearLiked").html("finished."); } else{ first.remove(); setTimeout(clearLiked,125); } } setTimeout(space,100); } function space(){ for(var iii=0;iii<5;iii++){ var one=jQuery(".f-single").eq(iii); if(one.length==0){ jQuery("#statusTable").find("tr").eq(iii).find("td").eq(0).html("nickName"); jQuery("#statusTable").find("tr").eq(iii).find("td").eq(1).html("timestamp"); jQuery("#statusTable").find("tr").eq(iii).find("td").eq(2).html("content"); } else{ var nickName = one.find(".f-nick a").html(); jQuery("#statusTable").find("tr").eq(iii).find("td").eq(0).html(nickName); var time = one.find(".info-detail .ui-mr8.state").html(); jQuery("#statusTable").find("tr").eq(iii).find("td").eq(1).html(time); var summary = one.find(".f-info").text(); jQuery("#statusTable").find("tr").eq(iii).find("td").eq(2).html(summary); } } } function up(){ console.log("上"); jQuery("#finishedClearLiked").html("pending."); clearLiked(); setTimeout(space,100); jQuery("#finishedClearLiked").html("finished."); } function left(){ console.log("左"); jQuery("#finishedClearLiked").html("free."); var first=jQuery(".f-single").eq(0); first.find(".qz_btn_reply").click(); setTimeout(space,100); } function down(){ console.log("下"); jQuery("#finishedClearLiked").html("free."); var first=jQuery(".f-single").eq(0); console.log(first); faded(first); setTimeout(space,100); } function right(){ console.log("右 点赞"); jQuery("#finishedClearLiked").html("free."); var first=jQuery(".f-single").eq(0); console.log(first); var zan=first.find("a.qz_like_btn_v3[data-clicklog='like']"); console.log(zan.length); if(zan.length!=0){ zan.eq(0).click(); } faded(first); setTimeout(space,150); } function beg(){ console.clear(); console.log("【【【【【】】】】】"); var $rect = jQuery('<div id="rect_div">\ <style>\ #rect_div{\ position: fixed; z-index: 999;top: 40px; width: 90%; text-align: center; left: 0px; right: 0px; margin-left: auto; margin-right: auto;\ }\ #rect {\ height: 140px; width: 210px; border:red 5px solid; \ }\ #rect:focus{ border:5px green solid; }\ #clearLikedDiv{\ vertical-align: top;border: 4px solid darkseagreen;width: 100px;height: 120px;\ display: inline-flex;flex-direction: column;background-color: wheat;\ }\ #qzone_fix_button{\ height: 50px; width: 100px; \ }\ #finishedClearLiked{\ border: skyblue 3px inset; font-size: 1.5em;\ }\ #startClearLiked{\ width: 100%;flex-grow: 1;\ }\ \ #statusTable{\ border-collapse: collapse;\ display: inline-table;\ vertical-align: top;\ }\ #statusTable tr td:nth-child(1){\ background-color: #FFFFCC;\ width: 100px;\ }\ #statusTable tr td:nth-child(2){\ background-color: #DDDDDD;\ width: 100px;\ }\ #statusTable tr td:nth-child(3){\ background-color: #CCFFCC;\ width: 300px;\ }\ </style>\ <div id="clearLikedDiv">\ <button id="qzone_fix_button" onclick="QZFL.cookie.set(\'page_engine_off\',1,\'qzone.qq.com\',\'/\',12);location = location.href;return false;">网络问题<br>立即修复</button>\ <span id="finishedClearLiked">free.</span>\ <button id="startClearLiked">清理已点赞</button>\ </div>\ <textarea type="input" id="rect" value="">输入区操作:\n触摸板双指上下滑刷新动态\n空格 加载前五条动态信息\n上 清理顶部已点赞\n下 下一条\n左 评论\n右 点赞</textarea>\ <table id="statusTable" border="2"><tr>\ <td>100</td><td>100</td><td>100</td>\ </tr><tr>\ <td>200</td><td>200</td><td>200</td>\ </tr><tr>\ <td>300</td><td>300</td><td>300</td>\ </tr><tr>\ <td>400</td><td>400</td><td>400</td>\ </tr><tr>\ <td>500</td><td>500</td><td>500</td>\ </tr></table>\ </div>'); jQuery("body").append($rect); jQuery("#startClearLiked").click(clearLiked); jQuery("head").append("<style id=\"addedCSS\" type=\"text/css\">a.item-on {background-color: red;}</style>");
jQuery("#rect").keydown(function(e){ var keycode = (Number)(e.keyCode); console.log(keycode); if(keycode == 32){ console.log("空格"); space(); }else if(keycode == 37){ left(); }else if(keycode == 38){ up(); }else if(keycode == 39){ right(); }else if(keycode == 40){ down(); } return false; }); } console.log("----等两秒----"); setTimeout(beg,2000); })();
|