Commit 05dce8efde8561c6434c976bb1142af9fe031973
add README
mix irving committed on 5/27/2018, 11:53:32 AMParent: 8ea0672560e531ebb37c8697fcd37dad9a96986e
Files changed
package.json | changed |
README.md | added |
package.json | ||
---|---|---|
@@ -1,19 +1,20 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "ssb-meme", |
3 | - "version": "1.0.0", | |
3 … | + "version": "0.0.0", | |
4 | 4 … | "description": "", |
5 | 5 … | "main": "index.js", |
6 … | + "repository": "https://github.com/ssbc/ssb-meme", | |
6 | 7 … | "directories": { |
7 | 8 … | "test": "test" |
8 | 9 … | }, |
9 | 10 … | "dependencies": { |
10 | - "file-type": "^8.0.0", | |
11 | 11 … | "flumeview-search": "^1.0.3", |
12 | 12 … | "is-my-json-valid": "^2.17.2", |
13 | 13 … | "ssb-ref": "^2.11.1" |
14 | 14 … | }, |
15 | 15 … | "devDependencies": { |
16 … | + "file-type": "^8.0.0", | |
16 | 17 … | "pull-stream": "^3.6.8", |
17 | 18 … | "scuttlebot": "^11.3.0", |
18 | 19 … | "ssb-blobs": "^1.1.5", |
19 | 20 … | "ssb-config": "^2.2.0", |
@@ -23,6 +24,6 @@ | ||
23 | 24 … | "test": "echo \"Error: no test specified\" && exit 1" |
24 | 25 … | }, |
25 | 26 … | "keywords": [], |
26 | 27 … | "author": "", |
27 | - "license": "ISC" | |
28 … | + "license": "MIT" | |
28 | 29 … | } |
README.md | ||
---|---|---|
@@ -1,0 +1,45 @@ | ||
1 … | +# ssb-meme | |
2 … | + | |
3 … | +Uses [flumeview-search](https://github.com/flumedb/flumeview-search) to build an index of all images names. | |
4 … | + | |
5 … | +## Example Usage | |
6 … | + | |
7 … | +```js | |
8 … | +var Scuttlebot = require('scuttlebot') | |
9 … | + | |
10 … | +Scuttlebot | |
11 … | + .use(require('scuttlebot/plugins/master')) | |
12 … | + .use(require('ssb-memes')) | |
13 … | + | |
14 … | +var sbot = Scuttlebot(config) // see test/index.js for details | |
15 … | + | |
16 … | +sbot.meme.search('hermes', (err, results) => { | |
17 … | + // ... | |
18 … | +}) | |
19 … | +``` | |
20 … | + | |
21 … | + | |
22 … | +## API | |
23 … | + | |
24 … | +### `sbot.meme.search(query, callback)` | |
25 … | + | |
26 … | +- `query` must be a string at least 3 characters long | |
27 … | +- `callback` recieves results as an object of form: | |
28 … | + | |
29 … | +```js | |
30 … | +{ | |
31 … | + '&234x234lass...': [ | |
32 … | + { name: 'hermes-spade', author:'@ye+4...', msg: '%q24dad323...' } | |
33 … | + { name: 'hermes-wacka', author:'@mox5...', msg: '%asdasd696...' } | |
34 … | + //... | |
35 … | + ] | |
36 … | + //... | |
37 … | +} | |
38 … | +``` | |
39 … | + | |
40 … | +msg is the message where this mention occured | |
41 … | + | |
42 … | +### `sbot.meme.query` | |
43 … | + | |
44 … | +this is the raw method provided by flumeview-search. Not recommended for general use | |
45 … | + |
Built with git-ssb-web