Greasy Fork

来自缓存

Greasy Fork is available in English.

vk.com Like By Press 1, Dislike Press - 2

Automate click like(1)/dislike(2) button for any 1st post on the page.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            vk.com Like By Press 1, Dislike Press - 2
// @name:en         vk.com Like By Press 1, Dislike Press - 2
// @name:ru         vk.com Лайк по нажатию 1, Дизлайк - 2
// @version         1.1.0
    //Add dislike on press 2
// @description     Automate click like(1)/dislike(2) button for any 1st post on the page.
// @description:en     Automate click like(1)/dislike(2) button for any 1st post on the page.
// @author          Paul Malyarevich
// @contributor     malyarevich
// @connect         vk.com
// @include         https://vk.cc/*
// @include         https://vk.com/*
// @include         https://www.vk.com/*
// @run-at          document-start
// @encoding        utf-8
// @namespace http://greasyfork.icu/users/217675
// ==/UserScript==

document.addEventListener("keydown", function(e){
	if(e.key === "1") {
		document.querySelector("div.post_info > div.like_wrap > div.like_cont > div.like_btns > a.like_btn.like._like:not(.active)").scrollIntoView({block: "end", inline: "nearest"});
		document.querySelector("div.post_info > div.like_wrap > div.like_cont > div.like_btns > a.like_btn.like._like:not(.active)").click();
	} else if(e.key === "2") {
		document.querySelector("div.post_info > div.like_wrap > div.like_cont > div.like_btns > a.like_btn.like._like.active").scrollIntoView({block: "end", inline: "nearest"});
		document.querySelector("div.post_info > div.like_wrap > div.like_cont > div.like_btns > a.like_btn.like._like.active").click();
	}
})