Giter Club home page Giter Club logo

coinmarketcap-scraper's Introduction

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.