1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Ruby Gem for consuming API

Discussion in 'Community Dev Corner' started by splittingred, Feb 20, 2013.

Mods: Downburst, Mazey
  1. Hai. I made a Ruby gem for consuming the KAG API:

    URL/GitHub:
    https://rubygems.org/gems/kagerator
    https://github.com/splittingred/Kagerator

    Installation:
    Code:
    gem install kagerator
    Usage:
    Code:
    require 'kagerator'
     
    # player info
    player = Kagerator.player("splittingred")
    puts player[:playerInfo][:status]
     
    # server info
    server = Kagerator.server("74.91.114.49",50301)
    puts server[:serverStatus][:description]
     
    # server list
    servers = Kagerator.servers({:empty => 0,:full => 0})
    servers[:serverList].each do |server|
      puts server[:serverName]+"<br />"
    end
    Enjoy!
     
  2. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Hey cool, will look into it, I know some ruby,
     
Mods: Downburst, Mazey