9gag-feed
Loads 9gag feeds
Last updated 4 years ago by mquintal .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install 9gag-feed 
SYNC missed versions from official npm registry.

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]
}
*/

Current Tags

  • 1.0.0                                ...           latest (4 years ago)

1 Versions

  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 2
Last Month 3
Dependencies (4)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |