masterT / slackmojis-scraper

A scraper for https://slackmojis.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slackmojis-scraper

Build Status

A scraper for https://slackmojis.com/

Requirements

  • Node.js >= v10.16.3
  • npm

Install

Using npm:

npm install --save masterT/slackmojis-scraper

Usage

getEmojis

Return a Promise that resolve with an Array of emoji that matches the JSON schema schemas/emojis.json.

Usage:

cosnt SlackmojisScraper = require ('slackmojis-scraper')

SlackmojisScraper.getEmojis()
  .then((emojis) => {
    console.log(emojis[0])
    // {
    //   name: 'troll',
    //   filename: 'troll.png',
    //   url: 'https://emojis.slackmojis.com/emojis/images/1463602125/429/troll.png?1463602125' }
    // }
  .catch((error) => {
    console.log(error)
  })

Examples

Downloader

examples/downloader.js

Download all the emojis in a directory, by default it will download it in the ./tmp directory. This pairs well with the slack-emoji-upload.

Usage:

node examples/downloader.js

Output:

Downloading 827 emojis in ./tmp directory.
...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Done!

Developement

Install dependencies:

npm install

Test

Feature tests are run daily, thank to Travis Ci new feature CRON Jobs. This way we know if the scraper is ever broken.

Run the tests:

npm test

License

MIT

About

A scraper for https://slackmojis.com

License:MIT License


Languages

Language:JavaScript 100.0%