9gag-feed
v1.0.0
Published
Loads 9gag feeds
Downloads
11
Readme
9gag-feed
Description
Loads 9gag feeds.
Installation
This package is available on [npm][npm-url] as: 9gag-feed
npm install 9gag-feed --save
## Test
npm run test
Usage
Syntax: list ( [isParsedObject
], [lastItemId
], [isParsedObject
] )
Return a promise with a feed of ten post
Arguments
isParsedObject
Boolean (optional) If set, the provied list of posts will be parsed objects. If not, the provied list of post will be Item objects.lastItemId
Sring (optional) Must the last item ID loaded. If not set it load the first ten 9gag posts.
Syntax: get ( itemId
, [isParsedObject
] )
Return a promise with a feed of ten posts
Arguments
lastItemId
String Must be the item ID (form 9gag post)isParsedObject
Boolean (optional) If set, the provied the post will be an parsed object. If not, the post will be an Item object.
Return a promise with a post data
Examples:
using get method
var gagFeed = require('9gag-feed');
gagFeed.get( 'xxxxx' ).then( console.log )
// OUTPUT
/*
{
data: {
getId: [Function: getId],
getCaption: [Function: getCaption],
getImages: [Function: getImages],
getLink: [Function: getLink],
getVotes: [Function: getVotes],
getComments: [Function: getComments],
parse: [Function: parse]
}
}
*/
gagFeed.get( 'xxxxx', true ).then( console.log )
// OUTPUT
/*
{
data: {
getId: [String],
getCaption: [String],
getImages: [Object],
getLink: [String],
getVotes: [Object],
getComments: [Object],
parse: [Object]
}
}
*/
using list method
var gagFeed = require('9gag-feed');
gagFeed.list( true ).then( console.log )
// OUTPUT
/*
{
data: [
{
getId: [String],
getCaption: [String],
getImages: [Object],
getLink: [String],
getVotes: [Object],
getComments: [Object],
parse: [Object]
}
],
lastId: [String]
}
*/
gagFeed.list( 'xxxxx', true ).then( console.log )
// OUTPUT
/*
{
data: [
{
getId: [String],
getCaption: [String],
getImages: [Object],
getLink: [String],
getVotes: [Object],
getComments: [Object],
parse: [Object]
},
.....
],
lastId: [String]
}
*/
gagFeed.list( 'xxxxx' ).then( console.log )
// OUTPUT
/*
{
data: [
{
getId: [Function: getId],
getCaption: [Function: getCaption],
getImages: [Function: getImages],
getLink: [Function: getLink],
getVotes: [Function: getVotes],
getComments: [Function: getComments],
parse: [Function: parse]
},
...
],
lastId: [String]
}
*/