Greasy Fork is available in English.

Get User Hash

Get any user's hash, for various activities

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/19550/659176/Get%20User%20Hash.js

/*
 *  @name         Get User Hash
 *  @namespace    pxgamer
 *  @version      0.2.1
 *  @description  Get any user's hash, for various activities
 *  @author       pxgamer
 */

function guh(username) {
        let re = /<a href="\/bookmarks\/[a-z]+\/[a-z]+\/([a-z0-9]+)\/" class="[a-z]+Link kaButton smallButton normalText"><i class="ka ka-bookmark"><\/i>/ig, matches, ret = [];
        $.ajax({
            type: "GET",
            url: "/user/"+encodeURIComponent(username)+"/",
            async: false,
            success: function (data) {
                while (matches = re.exec(data.html)) {
                    ret.push(matches[1]);
                }
            },
            returnData: "json"
        });
        console.log(ret[0]);
        return ret[0];
    }