Hey Falconmick -
I'm not sure what level you're at with Ruby and Ruby on Rails so please excuse if I'm just saying things you already know.
Ruby on Rails is a framework to build websites - built using the Ruby language. To use the Heroes of Newearth XML API library, it's not required. You can use that library from a plain ruby script.
Here's what I did to get it to work:
1. I cloned the library to my local machine: git clone git://github.com/chrisgillis/Heroes-of-Newerth-XML-API-Wrapper.git
2. In that new local library directory I created a file "test.rb".
3. In the test.rb file, I put in the following:
require 'hon'
@my_stats = HoN::PlayerStats.new("XXXXXX")
puts @my_stats.stat("acc_games_played")
@match = HoN::MatchStats.new("match_id")
puts @match.team_one
puts @match.team_two
puts @match.summary_stats("time_played")
puts @match.team_one_stats("tm_losses")
Make sure to replace XXXXXX with the account name that you want to query.
4. then from that directory in a terminal/shell I just ran: ruby test.rb
I get the following output:
Not that interesting but it successfully retrieves data from Heroes of Newerth and outputs the results.
Note: To expand on my earlier statement that Ruby on Rails isn't required: it isn't, but this library could also be used from within Ruby on Rails websites (which I'm planning to do myself shortly on http://g.ameface.com). If you're interested in that, let me know and I'll post my methods on how I do that to import data into a website (once I've got it working)
Hope this helps.
Last edited by pglombardo (2011-04-06 00:20:22)