userStats

Methods

(async, inner) userStats(subdomains, tokens, cookies, options) → {Promise.<userStatsResponseObject>}

Get a few useful-ish statistics for either specific users, or the top-n emoji creators

Parameters:
Name Type Description
subdomains string | Array.<string>

a single or list of subdomains to analyze. Must match respectively to tokens and cookies.

tokens string | Array.<string>

a single or list of tokens to add emoji to. Must match respectively to subdomains and cookies.

cookies string | Array.<string>

a single or list of cookies used to authenticate access to the given subdomain. Must match respectively to subdomains and tokens.

options object

contains options for what stats to present

Properties
Name Type Attributes Description
user string | Array.<string> <optional>

user name or array of user names you would like to retrieve user statistics on. If specified, ignores top

top Number <optional>

count of top n emoji contriubtors you would like to retrieve user statistics on

bustCache boolean <optional>

if true, ignore any adminList younger than 24 hours and repull slack instance's existing emoji. Can be useful for making options.avoidCollisions more accurate

output boolean <optional>

if false, no files will be written during execution. Prevents saving of adminList for future use, as well as the writing of log files

verbose boolean <optional>

if true, all messages will be written to stdout in addition to combined log file.

Source:
Example
var userStatsOptions = {
  user: ['username_1', 'username_2'] // get me some info on these two users
};
var userStatsResults = await emojme.userStats('mySubdomain', 'myToken', 'myCookie', userStatsOptions);
console.log(userStatsResults);
// {
//   mySubdomain: {
//     userStatsResults: [
//       {
//         user: 'username_1',
//         userEmoji: [{ all username_1's emoji }],
//         subdomain: mySubdomain,
//         originalCount: x,
//         aliasCount: y,
//         totalCount: x + y,
//         percentage: (x + y) / mySubdomain's total emoji count
//       },
//       {
//         user: 'username_2',
//         userEmoji: [{ all username_2's emoji }],
//         subdomain: mySubdomain,
//         originalCount: x,
//         aliasCount: y,
//         totalCount: x + y,
//         percentage: (x + y) / mySubdomain's total emoji count
//       }
//     ]
//   }
// }

Type Definitions

userStatsResponseObject :object

The user-specific userStats response object, like other response objects, is organized by input subdomain.

Properties:
Name Type Description
subdomain object

each subdomain passed in to add will appear as a key in the response

Properties
Name Type Description
emojiList Array.<emojiList>

the list of emoji downloaded from subdomain

userStatsResults Array.<object>

an array of user stats objects

Properties
Name Type Description
userStatsObject object

An object containing several maybe-useful statistics, separated by user

Properties
Name Type Description
user string

the name of the user in question

userEmoji Array.<emojiList>

the emojiList the user authored

subdomain string

redundant :shrug:

originalCount Number

the number of original emoji the user has created

aliasCount Number

the number of emoji aliases the user has defined

totalCount Number

the number of original and aliases the user has created

percentage Number

the percentage of emoji in the given subdomain that the user is responsible for

Source: