Show me the value of litecoin when I unlock the phone

It simply shows you the current value of litecoin when you unlock the phone.

It simply shows you the current value of litecoin when you unlock the phone. It's based on the data from BTC-E market.

I accept donations at: LZFNDJkDT7YuWkQW1J31a3PMTeCsmFLrMs

To use this on{X} Recipe, simply copy the code below and modify if needed.

device.screen.on("unlock", function(){
    device.ajax(
    {
      url: 'https://btc-e.com/api/2/10/ticker',
      type: 'GET'
    },
    function onSuccess(body, textStatus, response) {
      var parsedBody;
      if(!(body && (parsedBody = JSON.parse(body)))) {
        var error = {};
        error.message = 'invalid body format';
        error.content = body;
        console.error('error: ',error);
      }
      
      var notification = device.notifications.createNotification('Litecoin value');
      notification.content = parsedBody.ticker.sell + "BTC";
      notification.on('click', function(){
        device.browser.launch('https://btc-e.com/exchange/ltc_btc');
      });
      notification.show();
      console.info('successfully received http response from btc-e!');
    });
});

Recipe Wall

1,430

Views