Advertisement
jimgreeno

Untitled

Sep 16th, 2017
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. /*
  2.  *  @name         Get Online Users
  3.  *  @namespace    PXgamer
  4.  *  @version      0.2
  5.  *  @description  Get list of users from Community page
  6.  *  @author       PXgamer
  7.  */
  8.  
  9. function gou() {
  10.     'use strict';
  11.  
  12.     var returnedData;
  13.     var searchString = /<a href="\/user\/[a-z)-9_.-]+\/" class="tag1 aclColor_[0-9a-z]">([a-z)-9_.-]+)<\/a>/gi, matches, onlineUsers = [];
  14.  
  15.     $.ajax({
  16.         type: "GET",
  17.         url: "/community/",
  18.         async: false,
  19.         success: function (data) {
  20.             returnedData = data;
  21.             while (matches = searchString.exec(returnedData.html)) {
  22.                 onlineUsers.push(matches[1]);
  23.             }
  24.             console.log(onlineUsers);
  25.         },
  26.         returnData: "json"
  27.     });
  28.     return onlineUsers;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement