Catalog npm
Back to packageRELEASE DETAILS

4.0.0

npm

9gag

Download 9GAG posts and comments

9gagcacheofflinescrapper
Published9 Jun 2020
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
fs-extra
Environment
{
  "local_name": "fs-extra",
  "alias": false,
  "peer_metadata": null
}
^8.1.0runtime
handlebars
Environment
{
  "local_name": "handlebars",
  "alias": false,
  "peer_metadata": null
}
^4.7.3runtime
node-fetch
Environment
{
  "local_name": "node-fetch",
  "alias": false,
  "peer_metadata": null
}
^2.6.0runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.2.0development
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^5.7.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^5.2.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-j2FExK2mO/J329Ti+jGqt2mZWOkUsZL/ijmhoJQBWxYuj9w4jodu9o9x8AZiPIrAmUwIHJA88zsAaPD0D6RKvw==",
  "shasum": "e5d5b069a95e01969249a6964d95d762b4d3d868",
  "tarball": "https://registry.npmjs.org/9gag/-/9gag-4.0.0.tgz",
  "fileCount": 23,
  "unpackedSize": 1014762,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe39cFCRA9TVsSAnZWagAAkbkP/R0+yC9oT8d1Cekugrh6\nFpGPwCgw80oPl/KShb6Tzf9uXBEDtZZvDY/2acvKfmQEU1RYkFB1FJdUyZmH\nyMwp3J8OBOjbybJYh1MDwPFGtvRBIOHW3fKhdurbaz9qwPobJMAwg9BRhVJJ\nTvHrQxegnCg5IlO8fRgvV1GjjUK9MYvZFfcH0YA+oNm9zAfPxgaGP/9VmT7j\n3N46oD6PKylxqBTc6l6+4p+AYRWokVQQmQ3ml1w6wLaDxenkH5Ur+jgHtemJ\nNGExmez7ie1Zmn8xi8u1BMJ680SuxW/Rx/PPF1uWAacHCIy7D3z9rQJXCWzB\nOWsYfifPQj6dfJzVzLB6DxaretjkU+CmPYLUbheoh0G30EfGcOLP35pHtIdd\nnYZl5+dQNlNZL/rcPz3xEv2iqd6o8ZrCtJVjQmMBIR1MW/Q0TY5CRD2WUmxi\nR9tj+6koZbQNDRuNgTVNld2rxpLAzQOP2RyuWqrIcdPGzPkxaAFxQNzaC15Q\npPCc4npR3wDb9cu02UCdpWrmKypSY7yieEecx1J0STXA3FlDYNeTugh4WECB\nGz+dyo04RYTVPC4TOLRNY/teA72EVdnoQjKOwwWysBye/p1wVq6dwQJMS4iO\nSrT0Ra4l2prXvqqUniBkUYkn6UwZADudhKqtTBXwNyeSEpU0WzDCCbpS6UwQ\ncS6k\r\n=ujxF\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQDxBlA4RafdVCtGH50epHNVmeOn5iLa0Gs/O7zXcrpsbgIhAN7ylsktKuDMx1c3KUDI5sa+G0tqk3jT/vSjgRmvkdee"
    }
  ]
}

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:c0fe3b85d9dc1b63c7e17f7a916ba32eeb18d3c2ea45b2ec37759be62e0c243e

Other collected versions

3.2.128 Mar3.2.028 Mar3.1.027 Mar3.0.027 Mar2.0.121 Oct2.0.05 NovView all collected versions →