Catalog npm
PACKAGE EXPLORERView in registry

9gag

npm

Download 9GAG posts and comments

9gagcacheofflinescrapper
Versions collected10
Direct dependencies6From release 4.0.0
Last observed20 Oct, 21:37 UTC

README

Current package documentation

9gag

A Node.js package to download 9GAG posts and comments.

It can be used as a module to scrap memes or as a command line application to save data to a local folder and generate an HTML file for offline use.

Node.js 8 or above required due to Async/Await usage.

Install

npm install 9gag

Examples

CLI

9gag <post_count> [<folder> default:output] [<section> default:hot] [<comment_count> default:0]
9gag 10
9gag 20 output trending 3

Testing

# unit
npm run test:unit
# unit + integration
npm test

Scrap posts and comments with images

const NineGag = require('9gag');
const Scraper = NineGag.Scraper;
const Downloader = NineGag.Downloader;

async function memes() {
    try {
        // number of posts, section and number of comments
        // can pass a custom http client as the last Scraper argument
        const scraper = new Scraper(10, 'hot', 3);
        const posts = await scraper.scrap();
        posts.forEach(p => console.log(`${p.title} -> ${p.content} -> ${p.comments.map(c => c.content)[0]}`));
        await new Downloader('output').downloadPosts(posts);
    }
    catch (err) {
        console.error(err);
    }
}

memes();

HTML output

demo

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 10

Collected releases
VersionPublishedDirect dependenciesOpen version
4.0.0Registry latest9 Jun 20206
3.2.128 Mar 20207
3.2.028 Mar 20207
3.1.027 Mar 20207
3.0.027 Mar 20207
2.0.121 Oct 20186
2.0.05 Nov 20176
1.0.29 Feb 201718
1.0.19 Feb 201718
1.0.09 Feb 201718

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
ruial/9gag

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:37 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:13a6729684b301bfc38284814070acc5123a994f5a998eaac92850239f91e72e