automatic praise machine

automatic praise

  1. // ==UserScript==
  2. // @namespace Violentmonkey Scripts
  3. // @name automatic praise machine
  4. // @version 1.2
  5. // @description automatic praise
  6. // @author 文不能测字
  7. // @include http*://ican.sf-express.com/*
  8. // @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
  9. // @grant GM.xmlHttpRequest
  10. // @grant GM.addStyle
  11. // @grant GM.getResourceText
  12. // @grant GM.getValue
  13. // @grant GM.setValue
  14. // @grant GM.info
  15. // @grant GM.registerMenuCommand
  16. // @grant GM_log
  17. // @grant GM_xmlHttpRequest
  18. // @grant GM_xmlhttpRequest
  19. // ==/UserScript==
  20. /*jshint esversion: 6 */
  21.  
  22. (function () {
  23. 'use strict';
  24. console.log("自动点赞项目开始1");
  25. const websiteList = [
  26. {
  27. "url": "工行卡寄递:http://ican.sf-express.com/#/comInnovateDetail/4232",
  28. "description": "工行卡寄递",
  29. "microInnoId": 4232
  30. },
  31. {
  32. "url": "http://ican.sf-express.com/#/comInnovateDetail/4239",
  33. "description": "舟汽寄递",
  34. "microInnoId": 4239
  35. },
  36. {
  37. "url": "http://ican.sf-express.com/#/comInnovateDetail/4217",
  38. "description": "货微打",
  39. "microInnoId": 4217
  40. },
  41. ];
  42.  
  43. $(function () {
  44. console.log("自动点赞项目开始2");
  45. run(websiteList, changeLink);
  46.  
  47. });
  48.  
  49. })();
  50.  
  51. function run(websiteList, callback) {
  52. // 循环
  53. for (var i = 0; i < websiteList.length; ++i) {
  54. console.log("自动点赞项目列表" + websiteList[i].description);
  55. // GM_log("自动点赞项目列表" + websiteList[i].description);
  56. callback(websiteList[i]);
  57. }
  58.  
  59. }
  60.  
  61. // 点赞
  62. function changeLink(website) {
  63.  
  64. // 注册一个定时器
  65. var task = setInterval(function (event) {
  66.  
  67. // var myData = new FormData();
  68. // myData.append("microInnoId", website.microInnoId);
  69. // const data = '{"microInnoId=" + website.microInnoId}';
  70. GM_xmlhttpRequest({
  71. method: "POST",
  72. url: "http://chap-manage.sf-express.com/yearInno/base/praise",
  73. // data: data,
  74. data: JSON.stringify({microInnoId: website.microInnoId}),
  75. headers: {
  76. "Content-Type": "application/json"
  77. },
  78. onload: function (response) {
  79. console.log("恭喜 成功点赞" + website.description + website.url +" "+ response.responseText);
  80. // GM_log(response.responseText);
  81. },
  82. onerror: function (reponse) {
  83. //alert('error');
  84. console.log("error: ", reponse);
  85. // GM_log(reponse);
  86. }
  87. });
  88. // 关闭定时器
  89. clearInterval(task);
  90. }, 1000);
  91.  
  92.  
  93. }
  94.  
  95.