自动评论博客园,自己查看博客的时间

代码:

 1 // ==UserScript==
 2 // @name         自动评论博客园,自己查看博客的时间
 3 // @namespace    http://tampermonkey.net/
 4 // @version      0.1
 5 // @description  try to take over the world!
 6 // @author       You
 7 // @match        https://www.cnblogs.com/*
 8 // @grant        none
 9 // ==/UserScript==
10 (function() {
11     // 等待两秒钟再进行评论
12     setTimeout(function(){
13 
14 
15         //document.getElementsByClassName("tool-item-comment")[0].click();//能够打开评论区啦
16 
17         //document.getElementById("comment_content").value = c[temp_count];//能够赋值啦
18 
19         var time = new Date();
20 
21         document.getElementById("tbCommentBody").value ="我在: " +time.getFullYear()+"年 "+(time.getMonth()+1)+"月 "+time.getDate()+"日   "+time.getHours()+":"+time.getMinutes()+":"+time.getSeconds()+"  看过本篇博客!";//评论时间
22 
23 
24         document.getElementById("btn_comment_submit").click();//发表评论成功!
25 
26 },2000);//ajax do something
27 })();

猜你喜欢

转载自www.cnblogs.com/hwpbetter/p/12730740.html