您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
打开自动刷积分,通过联通OA进入法治在沃首页,挂机即可。每1s自动浏览点赞一篇文章。可在开发者工具控制台中查看提示信息。
当前为
// ==UserScript== // @name 联通内网-法治在沃,自动刷积分 // @namespace https://gitee.com/zouyongs/js-liantongdangxiao // @version 1.1 // @description 打开自动刷积分,通过联通OA进入法治在沃首页,挂机即可。每1s自动浏览点赞一篇文章。可在开发者工具控制台中查看提示信息。 // @author ysZou // @match http://lawplatform.unicom.local/unitework/pf/*.do // @icon http://aiportal.unicom.local/portal/v1/assets/images/icon/favicon.ico // @grant none // ==/UserScript== (function () { 'use strict'; // Your code here... //http://lawplatform.unicom.local/law/tpfLike/toLike.do // 设置全局cookie $.ajaxSetup({ xhrFields: { withCredentials: true } }); //签到 fetch("http://lawplatform.unicom.local/law/TpfAttendance/sgin.do", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", "x-requested-with": "XMLHttpRequest" }, "referrer": "http://lawplatform.unicom.local/unitework/pf/pfPage.do", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "POST", "mode": "cors", "credentials": "include" }).then(v=>{ console.log(v.msg) }); async function sleep(time) { return await new Promise((resolve) => setTimeout(resolve, time)); } var index = 0; //获取首页30个文章id function getID() { var arr; var as = document.querySelectorAll('li'); var ps = document.querySelectorAll('p'); arr = Array.from(as); //for(var i of arr){if(i && i.innerHTML && i.innerHTML.split('opendetail')[1] ){ //console.log(i.innerHTML.split('opendetail')[1].split('(\'')[1].split('\')')[0]) //}} var arrp = Array.from(ps); //for(var j of arrp){if(j && j.outerHTML && j.outerHTML.split('opendetail')[1] ){ //console.log(j.outerHTML.split('opendetail')[1].split('(\'')[1].split('\')')[0]) //}} arr = arr.concat(arrp) //去重 return [...new Set(arr)]; } //每3s发送一次点赞请求 function sendResPre3s(id) { setTimeout(() => { $.ajax({ url: 'http://lawplatform.unicom.local/law/tpfLike/toLike.do', // 请求的URL地址 type: 'POST', // 请求的方式(GET、POST等) dataType: 'json', // 响应的数据类型(json、xml等) data: { infoId: id }, success: function (data) { // 请求成功时的回调函数,data参数包含相应的数据 console.log(++index + '点赞-- ' + data.status + ' id=', id) }, error: function (xhr, status, error) { // 请求失败时的回调函数,xhr参数包含XMLHttpRequest对象,status参数包含错误状态,error参数包含错误信息 console.log('请求失败:' + status + ' - ' + error); } }); }, 500) //完整浏览文章 //浏览积分 var url = "http://lawplatform.unicom.local/law/tpfIntegralDetail/addBrowseIntegral.do" $.ajax({ url: url, type: "POST", data: { infoId: id }, success: function (data) { console.log('浏览--' + data.massege + ' id=', id) } }); } async function doMain(ms) { //主运行代码 var arrAll = getID(); for (var i of arrAll) { if (i) { if (i && i.innerHTML && i.innerHTML.split('opendetail')[1]) { var id = i.innerHTML.split('opendetail')[1].split('(\'')[1].split('\')')[0] console.log('睡眠' + ms / 1000 + 's....') await sleep(ms); sendResPre3s(id); } } if (i && i.outerHTML && i.outerHTML.split('opendetail')[1]) { var id1 = i.outerHTML.split('opendetail')[1].split('(\'')[1].split('\')')[0] console.log('睡眠' + ms / 1000 + 's....') await sleep(ms); sendResPre3s(id1); } } } doMain(3000); })();