Bitcoin Forum
June 29, 2024, 10:32:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Pebble Watch Script For The Obsessed Speculator  (Read 1661 times)
I_bitcoin (OP)
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
December 08, 2013, 11:50:10 PM
 #1

Warning, it may affect your mood Smiley

Requirements:

A pebble watch, tasker, android phone, and canvas.  You should have some basic knowledge of these.   Not hard just takes a bit of learning.

Note that the web call uses bitcoinaverage.com api vs. bitstamp api.

In tasker:

Add Net http get: to the web page of the bitcoinaverage.com api.

Add Script JavaScript: Set the path to your saved javascript file
   
Add Plugin> Pebble Notifier: Add notifier to "BitStamp"

You can change the percentages for the + and - as you see fit.




---script---
var parsebitstamp = JSON.parse(global('HTTPD'));

var err = "";
try {
       
       var bittemp = global('BitLast');
        var input= parsebitstamp['last'];
   setGlobal('BitLast', input);
   if (input >= bittemp)
        {
   var percent = 100-bittemp/input*100;
      if (percent > .25)
      {
       var lastout = "+";
           }
           else
      {
             var lastout = "=";
           }
    }

        if (input < bittemp)
   {
        var percent = 100-input/bittemp*100;
         if (percent > .25)
      {
       var lastout = "-";
           }
           else
      {
             var lastout = "=";
           }

   }


   setGlobal('LastOutA',global('LastOutB'));
        setGlobal('LastOutB',global('LastOutC'));
        setGlobal('LastOutC',global('LastOutD'));
        setGlobal('LastOutD',global('LastOutE'));
   setGlobal('LastOutE',global('LastOutF'));
   setGlobal('LastOutF',global('LastOutG'));
        setGlobal('LastOutG',lastout);
        var trend = global('LastOutA')+global('LastOutB')+global('LastOutC')+global('LastOutD')+global('LastOutE')+global('LastOutF')+global('LastOutG');
        var output = trend+input.toFixed(0);
     
}
catch(err) {
            output += err;
}

setGlobal('BitStamp', output);

-----

No matter where you go, there you are.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!