Coder Social home page Coder Social logo

mykeels / crypto-dip-alert Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 2.0 3.6 MB

Software that tells you when the price of a crypto has gone down.

License: MIT License

JavaScript 61.64% Starlark 4.09% Java 13.38% Objective-C 9.37% Ruby 11.52%
crypto crypto-dip react-native-app nodejs-script

crypto-dip-alert's Introduction

Crypto Dip Alert

Contains software for notifying the user, when the price of monitored cryptocurrency, drops past a set threshold.

Included Software

Third Party API

Custom Notifications

To add a Custom Notification Provider:

  • Create a file entry in the scripts/nodejs-crypto-dip-alert/notifications folder ending with .notification.js
  • Expose a notify function from module.exports
  • The function is an async function so return a Promise
  • Function has the following as parameters
    • coin
    • maxPrice
    • currentPrice
    • dipThreshold
  • You can add configs to the .env file to determine if custom notif will be used.
  • e.g. NOTIFY_YORUBA= NOTIFY_MAILGUN=

Example with Yoruba Notification

/**
 * posts a notification in the terminal console
 * @param {{symbol: string, priceUsd: number}} coin
 * @param {number} maxPrice
 * @param {number} currentPrice
 * @param {number} dipThreshold
 */
const notify = async (coin, maxPrice, currentPrice, dipThreshold) => {
  // early return if not set in env flags
  if (!process.env.NOTIFY_YORUBA || process.env.NOTIFY_YORUBA !== 'true') return;
  console.log(`[๐Ÿšจ๐Ÿšจ๐Ÿšจ๐Ÿ’ฐ๐Ÿšจ๐Ÿšจ๐Ÿšจ] Egbami, ye, ๐Ÿ˜ข ${coin.symbol} ti jona`);
  console.log(`[๐Ÿ‘€] Iwแปn ti o pแปju: ${maxPrice} `);
  console.log(`[๐Ÿ‘€] Ni in si: ${currentPrice} `);
  console.log(`[๐Ÿ‘€] ร€bรกwแปlรฉ: ${dipThreshold} `);
  // await here if you need to
  return Promise.resolve();
}

module.exports = notify;

crypto-dip-alert's People

Contributors

bolajiolajide avatar mykeels avatar oneeyedsunday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crypto-dip-alert's Issues

A price dip alert should end the program

Bug Description

When a price dip alert is detected, chances are there will be more, leading to multiple alerts which are annoying.

Expected Behaviour

When a price dip is detected, the program should end.

Network errors should not lead to failures

Bug Description

Currently, when an error is thrown due to network error, the program crashes.

Expected Behaviour

The program should be able to survive network errors.

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.