Skip to content
Boleslav Březovský edited this page Aug 29, 2018 · 2 revisions

Overview

One of main points of Gritter is to provide stats about Gitter chat rooms. Stats script gets list of rooms in given organization (Red in our case), downloads all messages and can perform different statistics over them. Downloaded messages are cached, so when statistics need to be updated, only new messages are downloaded.

Because downloading all messages takes a lot of time (there’s approximately XYZ messages in all Red rooms), it’s possible to get simplified statistics as online service on my server. Here basic stats are provided in form of webpage and also as data in three formats (Red, CSV, JSON). The online service provides only metadata as number of messages per user, per room, etc., so for better analysis, users are encouraged to download messages themselves locally.

Usage

After cloning Gritter repo, you need to provide your Gitter token that can be obtained from Gitter API page. Create a file that will look like this:

Red[]
token: #your-token-here

and save it as %options.red to Gritter directory. Then cd to %stats/ directory, fire up Red and do %stats.red. Stats will automatically download all required scripts using redquire and help will be shown.

get-data

get-data will download all messages from all rooms. If get-data was run previously, only new messages are downloaded. Two directories are created:

  • rooms - room metadata are stored here
  • messages - messages per room are stored here

Because downloading all messages takes a lot of memory it’s advised to close Red console session and restart it to query data.

get-stats

get-stats will produce data that are published to web. Most people probably won’t use this function.

init-rooms

To query downloaded data, open fresh Red console session, do %stats.red and then init-rooms. This will load messages into memory and make them available for you to work with them. See qobom below for examples.

init-users

init-users function will download user metadata.

qobom

qobom (query over block of maps) is simple query message that can be used to get different statistics about messages. See QOBOM description.

Clone this wiki locally