# nyanko

> Nyanko eat an image as a meal =＾● ⋏ ●＾=

Latest version **1.0.0** (published 2016-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install nyanko
pnpm add nyanko
yarn add nyanko
bun add nyanko
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-02-22 |
| First published | 2016-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | toihrk |
| Maintainers | toihrk |
| Keywords | nyanko |

## Links

- npm: https://www.npmjs.com/package/nyanko
- Repository: https://github.com/toihrk/nyanko
- Homepage: https://github.com/toihrk/nyanko#readme
- Issues: https://github.com/toihrk/nyanko/issues
- npm.io page: https://npm.io/package/nyanko

## Dependencies (2)

- [cron](https://npm.io/package/cron.md) ^1.1.0
- [coffee-script](https://npm.io/package/coffee-script.md) ^1.10.0

## Recent versions

- 1.0.0 (latest) — 2016-02-22

## README

# Nyanko =＾● ⋏ ●＾=

Nyanko eat an image as a meal =＾● ⋏ ●＾=


## Usage

```js
var nyanko = require('nyanko');

var nyankoTwitter = require('nyanko-twitter');
var nyankoTumblr  = require('nyanko-tumblr');

nyankoTwitter.configure({
  consumer_key:        process.env.TWITTER_CONSUMER_KEY,
  consumer_secret:     process.env.TWITTER_CONSUMER_SECRET,
  access_token_key:    process.env.TWITTER_ACCESS_TOKEN,
  access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
});

nyankoTumblr.configure({
  consumer_key:        process.env.TUMBLR_CONSUMER_KEY,
  consumer_secret:     process.env.TUMBLR_CONSUMER_SECRET,
  access_token_key:    process.env.TUMBLR_ACCESS_TOKEN_KEY,
  access_token_secret: process.env.TUMBLR_ACCESS_TOKEN_SECRET
});

nyanko.configure({
  cron: '0 */1 * * * *',
  keywords: ['cat', '猫'],
  providers: [
    nyankoTwitter,
    nyankoTumblr
  ]
});

nyanko.on('add', function(meal){
  // meal
  //  .url      - event url
  //  .provider - event provider
  //  .keyword  - event keyword
  //  .event    - event identifier
  //  .payload  - event some informations
  //
  // Some Action
});

nyanko.start();

```


## Install

```
npm install nyanko
```


## Plugin Develop

Implement `register()`

```js
exports.register = function(handler, config) {
  var keywords = config.keywords;
  // Ticking Event
  handler.on('tick', function(meal) {
    // Something...
    var image = {
      id:       'image_identifier',
      url:      'http://image_url',
      link:     'http://image_link',
      provider: 'plugin_name',
      keyword:  ['matched_keyword'],
      event:    'add', // available event 'config', 'init', 'tick', 'add'
      payload:  {}     // original event payload
    };
    handler.emit('add', image);
  });
}
```

see [nyanko-twitter](https://github.com/toihrk/nyanko/blob/master/nyanko-twitter), [nyanko-tumblr](https://github.com/toihrk/nyanko/blob/master/nyanko-tumblr)


## License

Distributed under the MIT License.

---
_Source: https://npm.io/package/nyanko · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
