Get Online Users

Get list of users from Community page

이 스크립트는 직접 설치해서 쓰는 게 아닙니다. 다른 스크립트가 메타 명령 // @require https://update.greasyfork.org/scripts/19524/659174/Get%20Online%20Users.js(으)로 포함하여 쓰는 라이브러리입니다.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
/*
 *  @name         Get Online Users
 *  @namespace    pxgamer
 *  @version      0.2
 *  @description  Get list of users from Community page
 *  @author       pxgamer
 */

function gou() {
    'use strict';

    let returnedData;
    let searchString = /<a href="\/user\/[a-z)-9_.-]+\/" class="tag1 aclColor_[0-9a-z]">([a-z)-9_.-]+)<\/a>/gi, matches, onlineUsers = [];

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