<commit_before>msw-subscribe
=============

[![Build Status](https://travis-ci.org/justinjmoses/msw-subscribe.png)](https://travis-ci.org/justinjmoses/msw-subscribe)

Node application to scan for swell matching specific criteria at any break across the world. Uses [MSW](http://magicseaweed.com) forecast data. 


##Quickstart

```javascript
//Add the API to your module
var msw = require('msw-subscription');

var subscription = mswSubscribe.create({
  apiKey: 'YOUR API KEY',
  units: 'us'
});

subscription.addSpot(2544,
  {
      minPeriod: 10,
      minBreakingHeight: 3,
      minSolidStars: 2,
      maxWindSpeed: 15,
      minSequence: 3
  } //see msw-api package for query details
});


subscription.query().then(function () {
  
  subscription.send({ 
    email: '<EMAIL>', 
    from: '<EMAIL>',
    subject: 'incoming swell alert'
  }).then(function () {
    //sent
  }, function (err) { 
    console.log(err);
  });
}, function (err) {
  console.log(err);
});
```<commit_msg>Updating README with cli usage<commit_after>msw-subscribe
=============

[![Build Status](https://travis-ci.org/justinjmoses/msw-subscribe.png)](https://travis-ci.org/justinjmoses/msw-subscribe)

CLI too to scan for swell matching specific criteria at any break across the world. Uses [MSW](http://magicseaweed.com) forecast data and [msw-api](https://npmjs.org/package/msw-api) node module to query the MSW API. 

##Quickstart

```sh
#install globally
npm install -g msw-subscribe

#run a query for spot 123 and if the forecast matches the query, email the recipients
msw recipient:<EMAIL> spot:123 units:us minBreakingHeight:3 minSequence:5
```
{'fraction_non_alphanumeric': 0.1518677281077771, 'fraction_numerical': 0.011635027556644213, 'mean_word_length': 4.138364779874214, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 5, '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': '1235564', 'n_tokens_mistral': 570, 'n_tokens_neox': 529, 'n_words': 142}