Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9d3879eb06
Fetching contributors…

Cannot retrieve contributors at this time

91 lines (69 sloc) 2.597 kb

Gamertag

An interface for accessing your XBOX Live profile and game data.

Install

gem install gamertag

Gemfile:

gem 'gamertag'

Usage

This gem fetches data from two independent sources, which has several implications such as one of the sources not being available, or an increased overhead when you only want to access some of the data. To this end the interface will allow you to access all data, just the profile data or just the played games data.

Example: Obtaining your profile and played games. Methods are those available to the simple profile and played games.

profile = Gamertag::Profile.new('Belial1984')
profile.gamertag
profile.recent_games {|game| game.title }
profile.played_games {|game| game.title }

Example: Obtaining your profile and recent games only

profile = Gamertag::SimpleProfile.new('Belial1984')

profile.gamertag
profile.profile_link
profile.account_status
profile.gender
profile.is_cheater
profile.online
profile.online_status
profile.reputation
profile.gamerscore
profile.location
profile.motto
profile.name
profile.bio
profile.avatars.small_gamerpic
profile.avatars.large_gamerpic
profile.avatars.body_gamerpic
profile.recent_games.each do |game|
  game.title
  game.tid # Probably some arbitrary title id
  game.marketplace_url
  game.compare_url
  game.image
  game.last_played
  game.earned_gamerscore
  game.available_gamerscore
  game.earned_achievements
  game.avilable_achievements
  game.percentage_complete
end

Example: Obtaining your played games only

played_games = Gamertag::PlayedGames.new('Belial1984')
played_games.each do |game|
  game.image
  game.last_played
  game.earned_gamerscore
  game.available_gamerscore
  game.earned_achievements
  game.available_achievements
  game.average_gamerscore
  game.relative_gamerscore  => :above_average || :below_average || :undefined
end

Documentation

You can find online documentation that describes the API in more detail.

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request.

Copyright

Copyright (c) 2011 Baris Balic, David Czarnecki.

Jump to Line
Something went wrong with that request. Please try again.