Read WoWArmory XML via PowerShell

Due to technical issues, I haven't posted here in several months. Now the server has been stable for almost a month, I have to work to get back into the routine of doing so.

Blizzard Entertainment, the makers of World of Warcraft, maintain an 'armory' site. This site allows players like myself to review their characters gear, stats and various achievements. The entire site is a XML dump formatted with a XSLT style sheet.

Unfortunately, when I attempted to use other tricks to read the XML content, it failed. The style sheet corrupts the data format and makes the content in fairly useless HTML.

That's when I found the PoshHTML download. Once you install this add-in for Powershell, it provides a number of easy to use html focused cmdlets. The hardest part was figuring out how to install it (see comments below).

#Uses Get-Web from http://huddledmasses.org/get-web-another-round-of-wget-for-powershell/
#PoshHTTP\Install.ps1 .\bin\release\poshHttpSnapIn.dll

$url = "http://www.wowarmory.com/character-sheet.xml?r=Malfurion&n=Elkagorasa"
$xmldoc = Get-Web $url
$xmldoc.html.page.characterInfo.charactertab.spell.hitRating

This code will return the 4 values under HitRating.
increasedHitPercent : 16.54
penetration : 0
reducedResist : 0
value : 434

Looking at the XML returned, there are numerous values available via code, some not posted on the website. For example:

$xmldoc.html.page.characterInfo.charactertab.items.item

Will return every item equipped on your character, what gems and enchants are on your toon. The enchant is a bit difficult to work backwards as it doesn't say Brilliant Spellthread, but the effect.

randomPropertiesId : 0
durability : 75
pickUp : PickUpCloth_Leather01
slot : 6
id : 45848
icon : inv_pants_cloth_24
gem0Id : 40113
permanentenchant : 3719
maxDurability : 75
gem1Id : 40113
seed : 0
putDown : PutDownCloth_Leather01
gem2Id : 0

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <blockquote> <center> <hr> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <drupal6>, <html>, <java>, <javascript>, <php>, <posh>.

More information about formatting options