Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

[DEPRECATED] A scraper built with puppeteer to retrieve your crypto assets balance on discord

Notifications You must be signed in to change notification settings

Sorok-Dva/coinmarketcap-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoinMarketCap Scraper

CoinMarketCap Scraper

Description

This application is a scraper built with puppeteer that will send on discord your crypto assets balance with screenshot or simply with text.

You can also retrieve your assets list in image (⚠If you have lot of assets in your wallet, the image preview sent on discord may be unreadable, but no panic, just open the original in your browser and you'll be able to perfectly zoom)

It is highly recommended using this app under a process manager like pm2, as it become a background process that will run on your server. If you don't have a dedicated server that is always on, consider using Heroku.

Prerequisites

  • node >= v11.7
  • npm
  • pm2

Quickstart

npm install
cp .env.sample .env
pm2 start app.js --name "CoinMarketCapScraper"

Env file

Before running for the first time, you need to fill your .env file with your own values.

CHROME_PATH=/usr/bin/chromium-browser
DISCORD_WEBHOOK_ID=
DISCORD_WEBHOOK_TOKEN=
CMC_LOGIN=email
CMC_PASS=password
CMC_DISCORD_MSG="Today Crypto Assets Balance :"
CMC_CRONJOB="44 11 * * *"
CMC_SEND_MODE="screenshot"
CMC_CURRENCY="EUR"
CMC_LIGHTMODE="night"
CMC_TIMERANGE=24H
CMC_SEND_ASSETS_LIST=true
  • CHROME_PATH: The path to a chromium browser used by puppeteer
  • DISCORD_WEBHOOK_ID: The discord webhook ID used to send crypto assets balance on your discord server (More info on Discord Support)
  • DISCORD_WEBHOOK_TOKEN: The discord webhook TOKEN used to send crypto assets balance on your discord server
  • CMC_LOGIN: Your email of your CoinMarketCap account
  • CMC_PASS: Your password of your CoinMarketCap account
  • CMC_DISCORD_MSG: The specific message to send before the text balance, working only if CMC_SEND_MODE=text
  • CMC_CRONJOB: The cronjob rule on you want to retrieve your crypto assets balance. By default, the cronjob rule is set at 11 PM 44 every day. (More info on Crontab.guru)
  • CMC_SEND_MODE: Which format to use to send balance on discord. text or screenshot 1
  • CMC_CURRENCY: Currency to use (default to EUR)
  • CMC_LIGHTMODE: Website theme to use for the screenshot (day or night)
  • CMC_TIMERANGE: Time range to use for the screenshot. (Format: 24H | 7D | 30D | 90D | ALL - it's case-sensitive)
  • CMC_SEND_ASSETS_LIST: Send your complete assets list as screen. (true or false)

1 : If you set the CMC_SEND_MODE to text, you'll have a diff with the previous captured balance. Maybe useful for automatic short time range scraping. See examples.

Examples

Default Text Mode

Text Mode with short time range (every minute (CMC_CRONJOB="*/1 * * * *"))

Default Screenshot Mode (Night theme, Eur, 24h)

Screenshot mode with custom settings (Day theme, USD, 90d)