Catalog npm
Back to packageRELEASE DETAILS

3.2.1

npm

9gag

Download 9GAG posts and comments

9gagcacheofflinescrapper
Published28 Mar 2020
Direct dependencies7
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 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^0.19.2runtime
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
puppeteer
Environment
{
  "local_name": "puppeteer",
  "alias": false,
  "peer_metadata": null
}
^2.1.1runtime
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-tf6GVqWBpH7/Xec/PEQlEIWkI1Gfs44wabH20JSsMTtcyN83xp2iERxQ49r91y4OSah0LW0hrUjm560AqrYb4A==",
  "shasum": "29d5fb5c53c432098a21ddb761cd19fd65f435f4",
  "tarball": "https://registry.npmjs.org/9gag/-/9gag-3.2.1.tgz",
  "fileCount": 23,
  "unpackedSize": 1015894,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef4RSCRA9TVsSAnZWagAA2X8P/1KNbXNGe0W7dN3y2RN3\nxp5a4n7AfKOgI4Ln76OeaY3Zzr8O092NHniyV2kBU5LtgKrzRdNNbM4ev/po\nWHjGBlXWFePKgEC6xwWkhhK0oT1kjMGOKSwcpvhUqU+8TNLfseuxqpkzCUDA\nB3khlWSnHYGNGn4oJNOdBClS/jlIfdAhdvYocBQ0I9hWmdtctBsjKK/GE4/M\nt/lrS1fN/qGPKy0Lvpw3V053gRs+dR0MiQTgjbTHGuzAr/RvCtHh4dRfp5Py\nQfWMKVvQqNX7Y9GNvuZH2r+t4W5uX8kRRkqyfE14G4jRMtV3PXd3c7fmTFxi\nB/0vEbO3eiv2pp7Yml3+2hyGeNEDfKgKZbX1UEbOg64Il1Wfjkn0guKVlP9J\nWO0PQwA0Ed/zEMDPk0NynmiXFEM0kvuMsK9W/khg2cHcoq+y1AYTygM0oHje\nsBtIi5i1VtPhX9awSteEt0UztX95pPCPWyWvGdOo8YhJJJgrelEE74TQg9tL\nh3Dge/1U3ZAqX+UJx1wtnxxgeX0F2cV5f1Ugra3TgSRJtWLLXXP/ivfERVGK\nLGi6cJU+A5xBsI4KvO6FDQRTbEzX4q391cHVDORSrujEiYd2LZaYJK5g5EsT\nxKkcfEYOWl6LlNFMMUa1OvAnspcbd52fbuO4M5jJ3fp8HyUh+ceC40jzlWSD\nnlwg\r\n=yjXr\r\n-----END PGP SIGNATURE-----\r\n",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIBcYfTka9AcxFAt04SP9g50pwQM5hddv+m51UAk0JVHwAiBnzIQctl0ZMWAKDkrpkWmlJSNiB/eNlVHG7V1eZYU5aA=="
    }
  ]
}

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:0a4d13849a5fd2f86c642be0502ecf5d7bc05be53de6bb7a5b3554bdcd8448d6

Other collected versions

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