@icyflame/node-9gag
Version:
A simple API for accessing 9gag
63 lines (51 loc) • 874 B
Markdown
*A simple API for accessing 9gag*
npm install node-9gag
```js
var gag = require('node-9gag')
```
- Find a post on 9gag
```js
gag.find('query', function (err, res) {
// res = [
// {
// query: ,
// sectionHeader: ,
// result: {
// title: ,
// id: ,
// url: ,
// image:
// }
// }
// ]
});
```
- Get details of a post from its id
```js
gag.getItem('id', function (err, res) {
// res = {
// title: ,
// points: ,
// commentCount: ,
// image:
// }
});
```
- Access a section on 9gag (defaults to hot)
```js
gag.section('section'[, hot/fresh], function (err, res) {
// res = [
// {
// title: null,
// id: null,
// url: null,
// image: null,
// points: null,
// commentCount: null
// }
// ]
});
```