Greasy Fork

Greasy Fork is available in English.

Steam 好友动态自动点赞

让Steam成为动态朋友圈,为她/他点赞o( ̄▽ ̄)d

当前为 2019-03-11 提交的版本,查看 最新版本

// ==UserScript==
// @name         Steam 好友动态自动点赞
// @namespace    https://steamcommunity.com/id/GarenMorbid/
// @version      0.2
// @description  让Steam成为动态朋友圈,为她/他点赞o( ̄▽ ̄)d
// @author       Garen
// @match        https://steamcommunity.com/id/*/home/
// @grant        none
// ==/UserScript==

// 自动刷新页面的时间默认设置为200s
var timeout = 200;
// 获取当前页面的URL链接
var locationUrl = location.href;
// 批量点赞,支持好友动态以及评测动态
var list = document.getElementsByClassName('thumb_up');

for(var i = 0;i < list.length; i++){
    console.log(list[i].parentNode.parentNode.getAttribute('class').indexOf('active'));
    if (list[i].parentNode.parentNode.getAttribute('class').indexOf('active') == -1) {
        list[i].click();
    }
}
// 自动刷新页面
setTimeout(function () {
    location.replace(locationUrl);
}, timeout * 1000);