Bustikated

Equal parts geeknobabble & jackassery

WeeWar API Players

Posted by BM5k on February 24, 2008 at 07:48 PM

If you haven’t already, see Part 1

I’ve thrown together a script that requests my player info, and outputs it to the screen. You can see the returned xml data here.

Example Output

About Me
name => BM5k
online => true
id => 10908

My Stats
wins => 9
losses => 4
draws => 1
credits => 103350
points => 1523

Friends
sbowerman, bowerman4875, spacecadetjuno

Games
56945, 56698, 56939, 56992, 57266, 57641, 57639

The API Player Object

The WeeWar API makes the following information available for each player:

Attributes of user element
nameStringPlayer’s name
idIntegerUnique ID
Sub elements
pointsIntegerScore
profileStringURL of profile page
profileImageStringURL of profile image
profileTextStringPlayer’s profile blurb
victoriesIntegerNumber of wins
drawsIntegerNumber of ties
lossesIntegerNumber of defeats
accountTypeStringPro or basic
onBooleanPlayer is online
readyToPlayBooleanPlayer is ready to play
gamesRunningIntegerNumber of current games
lastLoginDateTimeLast login timestamp
basesCapturedIntegerNumber of bases captured across all games
creditsSpentIntegerTotal expenditure across all games
favoriteUnitsArray of Units3 most commonly built units
preferredPlayersArray of PlayersThis players’ friends
preferredByArrayof PlayersPlayers that befriend this player
gamesArray of GamesList of game ids
Units Array
unitObjectHas code attribute, a string containing the unit name
Players Array
playerObjectHas name and id attributes
Games Array
gameObjectContains ID element, the game’s unique id
Tags: API, Ruby, WeeWar
Hierarchy: previous, next

Comments

There are 0 comments on this post. Post yours →

Post a comment

Required fields in bold.