<commit_before># uwcua-vii

![Build Status](https://img.shields.io/travis/ghaiklor/uwcua-vii/master.svg) | ![Coverage Status](https://img.shields.io/coveralls/ghaiklor/uwcua-vii/master.svg) ![dependencies](https://img.shields.io/david/ghaiklor/uwcua-vii.svg) ![dev dependencies](https://img.shields.io/david/dev/ghaiklor/uwcua-vii.svg) [![Join the chat at https://gitter.im/ghaiklor/uwcua-vii](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ghaiklor/uwcua-vii?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Solution for UA Web Challenge VIІ.

Gitter bot which listen messages in the room by pattern `calc <expression>` and respond with result of `<expression>`.

## Usage

If you are installing this as global module:

```shell
npm install -g ghaiklor/uwcua-vii
gitter-bot ghaiklor/uwcua-vii
```

Or if you don't want to install it as global, you can install locally and run:

```shell
npm install ghaiklor/uwcua-vii
node ./node_modules/.bin/gitter-bot ghaiklor/uwcua-vii
```

By default room name is **ghaiklor/uwcua-vii**.
<commit_msg>Add more info to readme<commit_after># uwcua-vii

![Build Status](https://img.shields.io/travis/ghaiklor/uwcua-vii/master.svg) | ![Coverage Status](https://img.shields.io/coveralls/ghaiklor/uwcua-vii/master.svg) ![dependencies](https://img.shields.io/david/ghaiklor/uwcua-vii.svg) ![dev dependencies](https://img.shields.io/david/dev/ghaiklor/uwcua-vii.svg) [![Join the chat at https://gitter.im/ghaiklor/uwcua-vii](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ghaiklor/uwcua-vii?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Solution for UA Web Challenge VIІ.

Gitter bot which listen messages in the room and execute them as JavaScript expression.

## Getting Started

You can quickly see the results just navigating to [Gitter chat room](https://gitter.im/ghaiklor/uwcua-vii).
Type `calc <expression>` and send this message.
You will get respond with result of this expression.

## CLI Usage

If you are installing this as global module:

```shell
npm install -g ghaiklor/uwcua-vii
gitter-bot --key <key> --room <room> --pattern <regex>
```

Or if you don't want to install it as global, you can install locally and run:

```shell
npm install ghaiklor/uwcua-vii
node ./node_modules/.bin/gitter-bot --key <key> --room <room> --pattern <pattern>
```

You can call `gitter-bot --help` for advanced info.

For example, you want to start bot with my room and custom pattern for respond.
Then you should execute:

```shell
gitter-bot --key <YOUR_API_KEY> --room ghaiklor/uwcua-vii --pattern "^my custom pattern"
```

## API

You can require this module and use it for your own gitter bot.

```javascript
var GitterBot = require('gitter-bot');

var myBot = new GitterBot({
  apiKey: 'YOUR_API_KEY',
  roomName: 'ghaiklor/uwcua-vii',
  execPattern: /^calc\s+/
});
```

{'fraction_non_alphanumeric': 0.14260989961924542, 'fraction_numerical': 0.0013845621322256837, 'mean_word_length': 4.677799607072692, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 15, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2417944', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1041, 'n_words': 266}