Last active
December 23, 2015 05:29
-
-
Save Pent/6587058 to your computer and use it in GitHub Desktop.
api call example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Meteor.methods({ | |
| btce: function(to) { | |
| var str = ''; | |
| Meteor.http.get('https://btc-e.com/api/2/btc_usd/ticker', function(error, response) { | |
| if (response.statusCode === 200) { | |
| var data = response.content; | |
| data = JSON.parse(data); | |
| if(data.ticker) { | |
| return ("BTC-E: BTC->USD: [" + data.ticker.avg + "]"); | |
| } | |
| } | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment