Get Online Users By ACL

Get list of users from Community page by ACL

2016-05-12 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/19628/125381/Get%20Online%20Users%20By%20ACL.js을(를) 사용하여 포함하는 라이브러리입니다.

// ==UserScript==
// @name         Get Online Users By ACL
// @namespace    PXgamer
// @version      0.5
// @description  Get list of users from Community page by ACL
// @author       PXgamer
// @grant        none
// ==/UserScript==

function gouba(aclRank) {

        var aclIds = [];
        aclIds.user = '1'; aclIds.vul = 'verified'; aclIds.eul = 'eliteuploader'; aclIds.super = '2'; aclIds.elite = '3';
        aclIds.translator = '4'; aclIds.fmod = '5'; aclIds.thelper = '6'; aclIds.tmod = '7';   aclIds.smod = '8';
        aclIds.staff = '9'; aclIds.admin = '10';

        var returnedData;
        var matches;
        var onlineUsers = [];

        var s = '<a href="\/user\/[a-z)-9_.-]+\/" class="tag1 aclColor_'+aclIds[aclRank]+'">([a-z)-9_.-]+)<\/a>';
        var searchString = new RegExp(s,'gi');


        console.log(searchString);

        $.ajax({
            type: "GET",
            url: "/community/",
            async: false,
            success: function (data) {
                returnedData = data;
                while (matches = searchString.exec(returnedData.html)) {
                    onlineUsers.push(matches[1]);
                }
            },
            returnData: "json"
        });
        return onlineUsers;
    }