Catalog npm
Back to packageRELEASE DETAILS

2.0.0

npm

9gag

Download 9GAG posts and comments

9gagcacheofflinescrapper
Published5 Nov 2017
Direct dependencies6
Transitive dependenciesNot calculated

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.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.17.0runtime
fs-extra
Environment
{
  "local_name": "fs-extra",
  "alias": false,
  "peer_metadata": null
}
^4.0.2runtime
handlebars
Environment
{
  "local_name": "handlebars",
  "alias": false,
  "peer_metadata": null
}
^4.0.11runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.1.2development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^4.10.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-RlbEtvz7m28ikSNSTy8ad/xGaOMHNkcczkG2HQ+1j1vkJPQYBFDC7s5kYTeOVFmy0iYH7vrLv1sqDbgrS+8Q0A==",
  "shasum": "039cc60dcc40b020a5c4f3799443f8c4d2414c85",
  "tarball": "https://registry.npmjs.org/9gag/-/9gag-2.0.0.tgz",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIC1RY7wPOSEnRCqB06/zdJJXJlLq2QH+YVI0pC5G45SAAiBxy0FVeJTPLFMfyGp2HatjPhHuQDcdlN1SgXSWpYY8Ig=="
    }
  ]
}

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_version:038fdee0dfde3fc681040dc52a29c349fa13f73a7ade3cdec33707f35baf60a7

Other collected versions

4.0.09 Jun3.2.128 Mar3.2.028 Mar3.1.027 Mar3.0.027 Mar2.0.121 OctView all collected versions →