Bustikated

Equal parts geeknobabble & jackassery

WeeWar API HQ

Posted by BM5k on February 24, 2008 at 10:36 PM

If you haven’t already, see parts 1, 2 and 3

This script checks your HQ and prints out a list of games. You can see the returned xml data here.

Example Output

Active Games
One if by land
Someone else’s turn for the last 2 hours

It’s been brought
Someone else’s turn for the last 8 hours 12 Minutes

WAR 2
Someone else’s turn for the last 10 Minutes

Go Baby Go
Someone else’s turn for the last 1 hours 35 Minutes

Lobby
Moo, This Means War

The HQ Object

The HQ API request actually returns an array of games, appropriately as sub elements of game. If a game is waiting for you, it will have a boolean inNeedOfAttention attribute set to true.

Games Objects
idIntegerUnique game identifier
namestringThe name of the game
stateStringText status info
sinceStringDuration of current turn
linkStringURL of game page

The only other element of games is inNeedOfAttention an integer specifying how many of your games are waiting on you. Annoyingly, this includes games that haven’t started yet.

Tags: API, Ruby, WeeWar
Hierarchy: previous, next

Comments

There are 0 comments on this post. Post yours →

Post a comment

Required fields in bold.