Giter Club home page Giter Club logo

xbox-api's Introduction

Test Coverage

Code Climate

Description

This is a Ruby wrapper for the unofficial Xbox API located at http://xboxapi.com

#Installation

gem install xbox-api

Usage

Ruby Gem

One must first create a client that is able to interface with the Xbox API.
The client takes one argument; your xbox API token.

require "xbox-api"
client = XboxApi::Client.new("7ae98726beb982d987e7987ab1239a87")
#=> <XboxApi::Client:0x007fcc9215c8e8>

Using that client, one can then return a Gamer object

logan = client.gamer("oh hai loganz")

The XboxApi::Gamer instance responds to methods that correspond to API endpoints

logan.presence
logan.gamercard

The client also respond to #calls_remaining

client.calls_remaining
#=> {:limit=>"120", :remaining=>"112", :resets_in=>"452"}

You can fetch Xbox game details using either a games title id or game id in hex format

client.game_details(1708767297)

If one already has a gamer's XUID, the API lookup normally required to fetch an XUID during initialization may be skipped by passing in a client instance and the gamer's XUID as the third argument.

client = XboxApi::Client.new(ENV[:XBOX_TOKEN])
logan = XboxApi::Gamer.new("oh hai loganz", client, "189823798746")

Commad Line

The xbl binary may be invoked from the command line.

xbl -s theschoolmaster or xbl --status theschoolmaster may be used to retreive the status of a given player

If you have not yet supplied your API token from XboxApi.com, you will be prompted when trying to use xbl

Additionally, you may clear and set you token with xbl token

# clear your token
xbl token --clear

# set or view your token
xbl token

The API

Currently Supported Endpoints

Method Name Endpoint Short Description
profile /v2/{xuid}/profile This is the Profile for a specified XUID
gamercard /v2/{xuid}/gamercard This is the Gamercard information for a specified XUID
presence /v2/{xuid}/presence This is the current presence information for a specified XUID
activity /v2/{xuid}/activity This is the current activity information for a specified XUID
recent_activity /v2/{xuid}/activity/recent This is the recent activity information for a specified XUID
friends /v2/{xuid}/friends This is the friends information for a specified XUID
followers /v2/{xuid}/followers This is the followers information for a specified XUID
xbox360games /v2/{xuid}/xbox360games This is the Xbox 360 Games List for a specified XUID
xboxonegames /v2/{xuid}/xboxonegames This is the Xbox One Games List for a specified XUID
game_clips /v2/{xuid}/game-clips This is the current collection of clips for a specified XUID
game-details-hex /v2/game-details-hex/{id} This is the Xbox Game Information (using the game id in hex format)

xbox-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xbox-api's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.