Assume the date is 6:00:00 am on June 5, 2013

setTimeout(function () {$('.chatSend') [0].click(); },new Date(2013.5.4.5.0.0) -new Date()));
Copy the code

Circular sending (every 3 seconds)

setInterval(function(){$('.edit_area').html('Text to send');
   $(".edit_area").trigger($.Event("keydown", { keyCode: 13.ctrlKey: true}));
   $('.btn_send').click(); },3000);
Copy the code

Timed delivery (note the date format)

setInterval(function(){
          if(new Date().toLocaleString().indexOf('4:02:00 2015/8/31 afternoon') = = =0) 
             {$('.edit_area').html('Text to send');
              $(".edit_area").trigger($.Event("keydown", { keyCode: 13.ctrlKey: true}));
              $('.btn_send').click(); }},1000);
Copy the code

Chinese prickly ash live

setInterval(function(){$(".tt-type-msg").val("hello"The $()".tt-type-submit").click()
},3000)
Copy the code

Github

var i = 0;
for(; i<document.querySelectorAll("[aria-label='Star this repository']").length; i++){document.querySelectorAll("[aria-label='Star this repository']")[i].click()
}
Copy the code

const exec = require("child_process").exec;
module.exports = (cmd) = > {
    return new Promise((resolve, reject) = > {
        exec(cmd, function (error, stdout, stderr) {
            if (error) {
                console.log(error);
                reject(stderr);
            } else{ resolve(stdout); }}); }); };Copy the code
const fs = require("fs");
module.exports = (message) = > {
    return new Promise((resolve, reject) = > {
        fs.appendFile("message.txt".`${message}n`.(err) = > {
            err ? reject() : resolve();
        });
    });
};
Copy the code
const cmd = require("./cmd");
const file = require("./file");
let day = 10;
const random = (lower, upper) = > {
    return Math.floor(Math.random() * (upper - lower + 1)) + lower;
};
const commit = async() = > {const today = new Date(a); today.setTime( today.getTime() -0 * 24 * 60 * 60 * 1000 - day * 24 * 60 * 60 * 1000
    );
    let commitTime = `${today.getFullYear()}.${
        today.getMonth() + 1
    }.${today.getDate()}`;
    if (today.getFullYear() > 2019) {
        return;
    }
    let commitNumber = random(1.10);
    let dayNumber = random(1.3);
    while (commitNumber) {
        await file(commitTime);
        await cmd("git status");
        await cmd("git add .");
        await cmd(`git commit -m "${commitTime}" --no-edit --date="${commitTime}"`);
        commitNumber--;
    }
    if (day >= 10) {
        day -= dayNumber;
        commit();
    } else {
        // await cmd('git push origin master');}}; commit();Copy the code

Get comments and remove whitespace

$($(".tt-msg-content-h5.tt-msg-content-h5-chat"[$()".tt-msg-content-h5.tt-msg-content-h5-chat").length-1]).text().replace(/(^\s*)|(\s*$)/g."");
Copy the code
console.log("comments:" + $($(".tt-msg-content-h5.tt-msg-content-h5-chat"[$()".tt-msg-content-h5.tt-msg-content-h5-chat").length - 1]).text().replace(/(^\s*)|(\s*$)/g.""))
		$.ajax({
			type: "GET".url: "http://localhost:81/angular/0317/turing.php".data: {
				qu: $($(".tt-msg-content-h5.tt-msg-content-h5-chat"[$()".tt-msg-content-h5.tt-msg-content-h5-chat").length - 1]).text().replace(/(^\s*)|(\s*$)/g."")},success: function(data) {$(".tt-type-msg").val(JSON.parse(data).text)
			}
		})
Copy the code

ultimate

console.log("comments:" + $($(".tt-msg-content-h5.tt-msg-content-h5-chat"[$()".tt-msg-content-h5.tt-msg-content-h5-chat").length - 1]).text().replace(/(^\s*)|(\s*$)/g.""))
		$.ajax({
			type: "GET".url: "http://www.tuling123.com/openapi/api?key=c75ba576f50ddaa5fd2a87615d144ecf&info="+ $($(".tt-msg-content-h5.tt-msg-content-h5-chat"[$()".tt-msg-content-h5.tt-msg-content-h5-chat").length - 1]).text().replace(/(^\s*)|(\s*$)/g.""),
			success: function(data) {
                                console.log(data)
				$(".tt-type-msg").val(data.text)
				//$(".tt-type-submit").click()}})Copy the code

The Chrome plugin automatically evaluates core files

let stu = {
	userid: "xxx".password: "xxx".commit: ["666"."Very handsome."."Very impressive."."It's great."."Nothing like it."."Bright eyes."."Very impressive."."Not yet."."nice"."Wide range of knowledge, rich in extracurricular and classroom knowledge."."A great benefit and an admirable one."."good"."A lot of work experience as well as teaching."."Good"."Joker"."Easy to understand"."Lively and lively"."More humorous"."Talking too fast."."Keep up the good work"."Perfect"."Responsible and patient."."By surprise"."God level."]}let host = "";
let href = location.href.indexOf("?")? location.href.split("?") [0] : location.href;

switch(href) {
	/*case `${host}/student.php/Public/login`: document.querySelector("[name='Account']").value = stu.userid; document.querySelector("[name='PassWord']").value = stu.password; setTimeout(() => { document.querySelector("[type='submit']").click(); }, 500); break; * /
	case `${host}/student.php/Index/index`:
		location.href = `${host}/student.php/Index/evaluate`;
	case `${host}/student.php/Index/evaluate`:
		setTimeout(() = > {
			document.querySelector("[class='btn btn-xs btn-success']").click()
		})
		break;
	case `${host}/student.php/Index/start_evaluate`:
		let i = 0;
		let inputs = document.querySelectorAll("input");
		for(; i < inputs.length;) {
			document.querySelectorAll("input")[i].click();
			i += 4;
		}
		document.querySelectorAll("textarea") [0].value = stu.commit[Math.floor(Math.random() * stu.commit.length)];
		document.querySelectorAll("textarea") [1].value = stu.commit[Math.floor(Math.random() * stu.commit.length)];
		document.getElementById("addstudent").click();
}
Copy the code

Baidu climb figure

let y = 0;
let num = 0;
let imgArr = [];
setInterval(() = >{
	let imgs = document.querySelectorAll("img");
	let length = imgs.length;
	if(num! ==length){ num = length; imgArr = imgs;console.log(length,imgArr);
	}
	y = y + 1;
	scrollTo(0,y);
},1)
Copy the code

VSCode plug-in download

setInterval(() = > {
    i++;
    (function (i) {
        https.get('https://wscats.gallery.vsassets.io/_apis/public/gallery/publisher/Wscats/extension/ms-python.python/0.0.3/assetbyname/M icrosoft.VisualStudio.Services.VSIXPackage? redirect=true&install=true', {
            headers: {
                "accept": "* / *"."accept-encoding": "gzip, deflate, br"."accept-language": "zh-CN"."cookie": "EnableExternalSearchForVSCode=true"."user-agent": "VSCode 1.39.2"."x-market-client-id": "VSCode 1.39.2"."x-market-user-id": "f2500034-c981-4f54-bcdb-45bbf63994b3"}},function (res) {
            console.log(i);
        }).on('error'.function (e) {
            console.error("u51FAu73B0u9519u8BEF: " + e.message);
        });
    })(i);
}, 6000);
Copy the code
setInterval(() = >{
    document.querySelector('[aria-label="Download Extension"]').click()
},6000)
Copy the code

Wechat automatically replies

var num = 0;
setInterval(function(){
	// Listen for each new chat
	var messages = document.querySelectorAll(".js_message_plain")
	// Get the length of the message
	var length = messages.length
	// I will reply only if there is a new message
	if(num! =length){// If num and length are different, print a new message
		console.log(messages[length-1].innerHTML)
		if(messages[length-1].innerHTML=='hello') {var appElement = document.querySelector('[ng-controller=chatSenderController]');
			var $scope = angular.element(appElement).scope();
			$scope.editAreaCtn = "How are you?";
			$scope.sendTextMessage();
		}else if(messages[length-1].innerHTML=="Do it tonight or not?") {var appElement = document.querySelector('[ng-controller=chatSenderController]');
			var $scope = angular.element(appElement).scope();
			$scope.editAreaCtn = "Make.";
			$scope.sendTextMessage();
		}
		num = document.querySelectorAll(".js_message_plain").length
	}
},1000)
Copy the code

Listen for browser keyboard events

Global monitoring

document.onkeyup = function (e) {
    console.log(e.keyCode)
    e = e || window.event;
    e.preventDefault();
    console.log(e.keyCode);
    switch (e.keyCode) {
        case 38:
            console.log('the key');
            break;
        case 40:
            console.log(Under the 'key');
            break; }}Copy the code

Listen for all input fields on the page

console.log("Listen for all input fields")
// Get all input box nodes
let inputs = document.querySelectorAll("input");
// Iterate over all input nodes
[].forEach.call(inputs, (input) = > {
    input.addEventListener("input".(e) = > {
        // Prints the input value
        console.log(e.target)
        console.log(e.data)
    })
});
Copy the code

Right mouse click event

document.onmousedown = function (event) {
    var event = event || window.event
    if (event.button == "2") {
        // Do the processing here
        console.log("Click the right mouse button.",event)
        event.returnValue = false;
    };
} 
Copy the code