Coder Social home page Coder Social logo

mmlog's Introduction

mmlog

mmlog is a very primitive tool for dumping chat history from a Mattermost chat server.

Download and install

$ npm install -g mmlog

or:

$ git clone https://github.com/davepacheco/mmlog
$ cd mmlog
$ npm install

Generate a Mattermost authentication token

Before running the tool, you need to generate a Mattermost authentication token. You can do this using curl(1) from the command-line, and the easiest way is to follow the instructions in the Mattermost API documentation.

Generate an mmlog configuration file

mmlog looks for a configuration file in $HOME/.mmlogrc. This should be a JSON object with properties describing:

  • host, the host of your chat server (assumed to be running over https)
  • login_id, your login id
  • token, the authentication token described above
  • default_team, the team whose channels you want to search with mmlog

Here's an example (with the token elided):

$ cat ~/.mmlogrc
{
    "host": "chat.joyent.us",
    "login_id": "dap",
    "token": "...",
    "default_team": "joyent"
}

Run the program

With all that in place, you can run the program like this:

$ mmlog mib | tail -1
2017-09-01 14:03:29.993 ryan.zezeski           I do like me some lovely ticket prose.

In general, use:

mmlog [OPTIONS] CHANNEL

to print up to 1000 messages from channel CHANNEL.

The only option right now is --since DATE_TIME, which selects messages starting from the specified timestamp. This should generally be an ISO 8601 Date or DateTime, such as one of these:

mmlog --since=2017-09-01 mib
mmlog --since=2017-09-01T13:00Z mib

The timestamp is currently interpreted as UTC unless it contains a timezone in it, as in:

mmlog --since='2017-09-01T13:00-07:00' mib

However, timestamps for individual chat messages are printed in an ISO-8601-like format in the local time zone.

mmlog's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.