0

In my rails application i want to use lite coins api calls. please let me know how to use this api in rails application.

I have implemented for bit coins i got this code:

from this i am getting the bit coins current value:

 <%  response = HTTParty.get("http://data.mtgox.com/api/2/BTCINR/money/ticker") %> 
    <% high = response["data"]["high"]["value"] %>
    <%  low = response["data"]["low"]["value"] %>
    <%  avg = response["data"]["avg"]["value"] %>

If anyone knows similar to this please help me out finding the current value of lite coins.

user2931445
  • 19
  • 1
  • 6
  • you can create a function in lib file something: def get_coins response = HTTParty.get("http://data.mtgox.com/api/2/BTCINR/money/ticker") response end let me know if not works ? – Neelesh Dec 21 '13 at 06:57
  • i have implemented this for bit coins.the above code is for bitcoins and this is working fine. actually i need similar code for litecoins. – user2931445 Dec 21 '13 at 07:05
  • So I think you must look into this http://blockchain.info/api/blockchain_api , But I'm not sure. – Neelesh Dec 21 '13 at 07:08
  • I need for litecoins. If you have any idea about litecoins please help me. – user2931445 Dec 21 '13 at 07:18

1 Answers1

0

You need to parse JSON. Look into this: Parsing a JSON string in Ruby

Basically you get a hash of values and can use it as you like.

Your code won't work since you miss a parser.

Community
  • 1
  • 1
Zepplock
  • 28,655
  • 4
  • 35
  • 50