Permalink
Browse files

ignore ssl errors, set rejectUnauthorized:false

  • Loading branch information...
1 parent 2437a35 commit fecb5e7c734c283852e2b86ed5b2c78164ed4a1d @shimondoodkin committed Jun 26, 2014
Showing with 8 additions and 8 deletions.
  1. +8 −8 index.js
View
@@ -45,14 +45,14 @@ update=function(cb)
[
function(cb){cb=cbguard(cb);try{ rest.get('http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDILS=X').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} try{data=JSON.parse("["+data.trim().replace(/""/,"\\\"")+']');} catch(e){console.log(e.stack)} if(typeof data=='object' && data!==null)rates.dollar=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
// ,function(cb){cb=cbguard(cb);try{ rest.get('http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=EURILS=X').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} try{data=JSON.parse("["+data.trim().replace(/""/,"\\\"")+']');} catch(e){console.log(e.stack)} if(typeof data=='object' && data!==null)rates.euro=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
- ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitsofgold.co.il/api/btc').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitsofgold=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
- ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bit2c.co.il/Exchanges/BtcNis/Ticker.json').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bit2c=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
-// ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitgo.co.il/components/loadcontrol.aspx?cn=statspanel&json=true').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitgo=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
- ,function(cb){cb=cbguard(cb);try{ rest.get('https://api.bitcoinaverage.com/ticker/global/USD/').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitcoinaverageUSD=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
-// ,function(cb){cb=cbguard(cb);try{ rest.get('https://api.bitcoinaverage.com/ticker/global/EUR/').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitcoinaverageEUR=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
-// ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitstamp.net/api/ticker/').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) Object.keys(data).forEach(function(a){data[a]=parseFloat(data[a])}); rates.bitstamp=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
-// ,function(cb){cb=cbguard(cb);try{ rest.get('https://btc-e.com/api/2/btc_usd/ticker').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} try{data=JSON.parse(data);} catch(e){console.log(e.stack)} if(typeof data=='object' && data!==null) rates.btce=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
-/* ,function(cb){cb=cbguard(cb);try{ rest.get('https://bitpay.com/api/rates').on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null)
+ ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitsofgold.co.il/api/btc',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitsofgold=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
+ ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bit2c.co.il/Exchanges/BtcNis/Ticker.json',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bit2c=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
+// ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitgo.co.il/components/loadcontrol.aspx?cn=statspanel&json=true',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitgo=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
+ ,function(cb){cb=cbguard(cb);try{ rest.get('https://api.bitcoinaverage.com/ticker/global/USD/',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitcoinaverageUSD=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
+// ,function(cb){cb=cbguard(cb);try{ rest.get('https://api.bitcoinaverage.com/ticker/global/EUR/',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) rates.bitcoinaverageEUR=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
+// ,function(cb){cb=cbguard(cb);try{ rest.get('https://www.bitstamp.net/api/ticker/',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null) Object.keys(data).forEach(function(a){data[a]=parseFloat(data[a])}); rates.bitstamp=data; cb(); }); } catch(e){console.log(e.stack);cb();} }
+// ,function(cb){cb=cbguard(cb);try{ rest.get('https://btc-e.com/api/2/btc_usd/ticker',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} try{data=JSON.parse(data);} catch(e){console.log(e.stack)} if(typeof data=='object' && data!==null) rates.btce=data; }); cb(); } catch(e){console.log(e.stack);cb();} }
+/* ,function(cb){cb=cbguard(cb);try{ rest.get('https://bitpay.com/api/rates',{rejectUnauthorized:false}).on('complete', function(data) { if(data instanceof Error){console.log(data.stack);return cb();} if(typeof data=='object' && data!==null)
{
var d=[];
if(data.length && data[prev_usd].code=='USD' && data[prev_ils].code=='ILS')

0 comments on commit fecb5e7

Please sign in to comment.