Project showcase
Bitcoin Email notifier

Bitcoin Email notifier © MIT

When bitcoin rise or fall than certain amounts sends email.

  • 604 views
  • 1 comment
  • 1 respect

Components and supplies

About this project

When bitcoin rise or fall hard 1sheeld will send an email to notify you.


Code

CodeC/C++
replace every "example@example.com" with your destination email.
/*

Internet Shield Example

This example shows an application on 1Sheeld's internet shield.

By using this example, you can get response of certain GET request and 
print it all out on the terminal shield 64 bytes by 64 bytes.
 
OPTIONAL:
To reduce the library compiled size and limit its memory usage, you
can specify which shields you want to include in your sketch by
defining CUSTOM_SETTINGS and the shields respective INCLUDE_ define. 

*/

#define CUSTOM_SETTINGS
#define INCLUDE_INTERNET_SHIELD
#define INCLUDE_TERMINAL_SHIELD
#define INCLUDE_EMAIL_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

HttpRequest request ("https://blockchain.info/stats?format=json");
static boolean isSent = false;

void setup() {
  OneSheeld.begin();
  request.getResponse().setOnJsonResponse(&onJson);
  request.setOnFinish(&onFinish);
  Internet.performGet(request);
}
void loop() {
}
void onFinish() {
  request.getResponse()["market_price_usd"].query();
}
void onJson (JsonKeyChain & hell,char * res) {
  Terminal.println(res);
  int x=atoi(res);
  if(x > 225){
    if(!isSent){
      Terminal.println("Bitcoin is high");
      Email.send("example@example.com","Bitcoin !","Bitcoin is High");
      isSent = true;
    }  
  }else if(x < 200){
    if(!isSent){
      Terminal.println("Bitcoin is low");
      Email.send("example@example.com","Bitcoin !","Bitcoin is Low");;
      isSent = true;
    }  
  }else{
    isSent = false;
  }
  OneSheeld.delay(10000);
  Internet.performGet(request);
}

Schematics

Circuit
bitcoin_email.fzz

Comments

Similar projects you might like

Stocks market Analyzer

Project showcase by 1Sheeld

  • 1,276 views
  • 0 comments
  • 1 respect

Foursquare ultrasonic checkin

Project showcase by Guest

  • 581 views
  • 0 comments
  • 1 respect

Noise Level Notification Alert

Project showcase by 1Sheeld

  • 1,269 views
  • 0 comments
  • 5 respects

Skype Mobile

Project tutorial by Guest

  • 1,015 views
  • 0 comments
  • 3 respects

Pattern Access Door

Project showcase by 1Sheeld

  • 890 views
  • 1 comment
  • 6 respects

GLCD simple house

Project showcase by soso artist

  • 676 views
  • 0 comments
  • 1 respect
Add projectSign up / Login