open-index/open-npm huggingface dataset:
npm package: 9gag
Description: Download 9GAG posts and comments
Author: Rui Almeida
Latest version: 4.0.0

# 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](demo.png)
npm package: 9gag-random
Description: Download random 9gag.com pictures
Author: Nikolay Spiridonov
Latest version: 1.0.1

# 9gag-random
Download random pictures from [9gag.com](http://9gag.com/) to current dir

## Install

```
$ npm install --global 9gag-random
```


## Usage

```
$ 9gag-rnd
// => Saved as aA1GBo2.png
```

## License

MIT © [Nikolay Spiridonov](https://github.com/sohje)