Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "giffer", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "GIF download bot", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,6 +6,32 @@ # Giffer | ||
downloading gifs that were found by these adapters. It also saves some meta | ||
information and makes sure that the same gifs are not downloaded multiple times. | ||
information and makes sure that gifs with the same url are not downloaded multiple times. | ||
## API | ||
## `new Giffer(args)` | ||
There are some args you must/can provide when creating a new giffer client: | ||
- `db`: A `levelup` instance. _Important:_ Must have `valueEncoding: "json"` | ||
- `timeToRestart`: Time in ms after which an adapter should be started again after it has finished | ||
- `adapters`: An array of adapters. See [list of adapters](https://github.com/MaxGfeller/giffer/wiki/Modules#adapters) | ||
- `outputDir`: Where the files should be downloaded to | ||
```javascript | ||
var levelup = require('levelup') | ||
var GifferAdapter9Gag = require('giffer-adapter-9gag') | ||
var Giffer = require('giffer') | ||
var db = levelup('/whatever', { | ||
db: require('memdown'), | ||
valueEncoding: 'json' | ||
}) | ||
var adapter9gag = new GifferAdapter9Gag({}) | ||
var giffer = new Giffer({ | ||
db: db, | ||
outputDir: __dirname + '/images', | ||
adapters: [adapter9gag] | ||
}) | ||
``` | ||
### `start()` | ||
@@ -19,2 +45,10 @@ | ||
### `plugin(plugin[, args])` | ||
Easy way to use a plugin. | ||
```javascript | ||
giffer.plugin(require('giffer-validator')) | ||
``` | ||
## Events | ||
@@ -21,0 +55,0 @@ |
9318
81