// ==UserScript== // @name 西瓜视频自动回复评论 // @namespace http://tampermonkey.net/ // @version 0.83 // @description 自动回复西瓜视频的评论 // @author cpp // @license MIT // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @match https://studio.ixigua.com/comment // @icon https://www.google.com/s2/favicons?sz=64&domain=toutiao.com // @run-at document-idle // @grant none // @downloadURL none // ==/UserScript== /*/ var importJs=document.createElement('script') //在页面新建一个script标签 importJs.setAttribute("type","text/javascript") //给script标签增加type属性 importJs.setAttribute("src", 'https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js') //给script标签增加src属性, url地址为cdn公共库里的 document.getElementsByTagName("head")[0].appendChild(importJs) //把importJs标签添加在页面 //*/ window.onload = function() { setTimeout(function(){ function sleep(delay) { var start = (new Date()).getTime(); while ((new Date()).getTime() - start < delay) { continue; } } function post(commentId, userId, comment) { var da = { "ReplyToCommentId": commentId, "ReplyToReplyId": 0, "ReplyToUserId": userId, "Content": comment, "ImageList": [] }; $.ajax({ type: "POST", url: "https://studio.ixigua.com/api/comment/CommentReply", contentType: "application/json charset=utf-8", data: JSON.stringify(da), headers: { "accept": "*/*", "content-type": "application/json" }, dataType: "json", success: function (message) { console.log("msg:" + JSON.stringify(message)); }, error: function (message) { console.error("" + message) } }); } function clickButton(){ var comments=[ "感谢支持[玫瑰][玫瑰][玫瑰]", "谢谢您的支持[比心][比心][比心]", "谢谢支持,愿您平安健康,[祈祷][祈祷][祈祷]", "感恩支持,祝您幸福快乐,[玫瑰][玫瑰][玫瑰]", "感谢支持,祝您天天开心,笑口常开[祈祷][祈祷][祈祷]", "感谢支持,祝您幸福无限,百事可乐[祈祷][祈祷][祈祷]", "感谢支持,祝您永享幸福,财源滚滚[祈祷][祈祷][祈祷]", "感谢支持,祝您岁岁平安,蒸蒸日上[祈祷][祈祷][祈祷]", "感谢支持,祝您幸福安康,金玉满堂[祈祷][祈祷][祈祷]", "感谢支持,祝您顺心如意,大展宏图[祈祷][祈祷][祈祷]", "感谢支持,祝您心想事成,财源广进[祈祷][祈祷][祈祷]", "感谢支持,祝您幸福快乐,恭喜发财[祈祷][祈祷][祈祷]", "感谢支持,祝您身体倍儿棒,吃嘛嘛香[比心][比心][比心]" ]; var START = 0; var END = comments.length; var userComments = $(".m-comment-item"); var userImages = $(".user-img"); var diggButtons = $(".m-digg-btn"); for (var i=0; i { if (event.target.id == "reply-button") { event.stopPropagation(); clickButton(); console.log("sdfasdfa"); return; } }, true); }, 5000); }