<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kastang &#187; WoW</title>
	<atom:link href="http://kastang.com/blog/category/general/wow/feed/" rel="self" type="application/rss+xml" />
	<link>http://kastang.com</link>
	<description>Ramblings of a Geek</description>
	<lastBuildDate>Sat, 11 Jun 2011 00:30:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>WoW Realm Status PHP Class</title>
		<link>http://kastang.com/blog/2011/03/wow-realm-status-php-class/</link>
		<comments>http://kastang.com/blog/2011/03/wow-realm-status-php-class/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 12:54:45 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WoW]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=652</guid>
		<description><![CDATA[I am working on a PHP Class called RealmStatus that will pull WoW Realm information from the WoW Realm Status Page without XML feeds available. The RealmStatus Class currently supports the following operations: --getAllServers() - Returns an associative array of all Server Names, Statuses, Populations, Types, and Locale. --getServerType($) - Returns the type of a [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a PHP Class called <a href="https://github.com/Kastang/WoWRealmStatus">RealmStatus</a> that will pull WoW Realm information from the WoW Realm Status Page without XML feeds available. </p>
<p>The RealmStatus Class currently supports the following operations:<br />
<strong> --getAllServers()</strong> - Returns an associative array of all Server Names, Statuses, Populations, Types, and Locale.<br />
<strong>--getServerType($)</strong> - Returns the type of a given server.<br />
<strong>--getServerStatus($)</strong> - Returns the status of a given server.<br />
<strong>--getServerPopulation($)</strong> - Returns the population of a given server.<br />
<strong> --getServerLocale($)</strong> - Returns the locale of a given server. </p>
<p>For a detailed explanation of the operations, please read the function headers in the RealmStatus.php and example.php files. </p>
<p>The files can be pulled from GitHub <a href="https://github.com/Kastang/WoWRealmStatus">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2011/03/wow-realm-status-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WoW Roster PHP Class</title>
		<link>http://kastang.com/blog/2011/01/wow-roster-php-class/</link>
		<comments>http://kastang.com/blog/2011/01/wow-roster-php-class/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 17:35:30 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=639</guid>
		<description><![CDATA[I am working on a PHP Class called RosterAPI that will parse the WoW Armory without XML Files. Unlike my previous two posts (Part 1 and Part 2), the information for each character can be pulled through get methods. Also included in RosterAPI are guild specific functions not included in my previous posts. The following [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a PHP Class called <a href="https://github.com/Kastang/No-XML-WoW-Armory-Parser">RosterAPI</a> that will parse the WoW Armory without XML Files. Unlike my previous two posts (<a href="http://kastang.com/blog/2010/12/parsing-the-wow-armory-without-xml/">Part 1</a> and <a href="http://kastang.com/blog/2011/01/parsing-the-wow-armory-without-xml-part-2/">Part 2</a>), the information for each character can be pulled through <code>get</code> methods. Also included in RosterAPI are guild specific functions not included in my previous posts. </p>
<p>The following methods are currently included:</p>
<p><strong>Character Specific: </strong><br />
* getLevel()<br />
* getGender()<br />
* getClass()<br />
* getRace()<br />
* getAchievementPoints()<br />
* getProfessions(): Returns an associative array containing the name and value of each profession.<br />
* getTalents(): Returns an associative array containing the name and value of each talent tree.<br />
* getStat($stat): Please view the comment header of the getStat() function for a list of valid $stats. </p>
<p><strong>Guild Specific: </strong><br />
* getGuildMembers($rank): If $rank is true, an associative array containing guild names and ranks will be returned. If $rank is false, an array will be returned containing all names in the guild.<br />
* getTopWeeklyContributers(): Returns an array of the Top 5 Weekly Contributers in the guild.<br />
* getGuildPerks(): Returns an array of the perks a guild currently has. </p>
<h2> <strong>UPDATE:</strong> </h2>
<p>I have received several emails with suggestions over the past week. In addition to everything listed above, my RosterAPI will also:</p>
<p>*getItems: Returns an Associative Array that will return every item equipped on a character along with the Item Level, Enchants, and Gems.<br />
*getStatistics: Given a specific Statistic (ex: Number of deaths), the value of the statistic will be returned. </p>
<p>The code can be obtained via <a href="https://github.com/Kastang/No-XML-WoW-Armory-Parser">GitHub</a>. While it is still a work in progress, it should be stable enough for personal use. This class is being used to power the backend of the <a href="http://weknow.to/roster/">We Know Roster</a>. Please read the <code>README</code> file along with the <code>example.php</code> file for a brief introduction on how to use the class. I recommend reading the comments above each function in RosterAPI to understand what exactly will be returned (especially with those functions that return associative arrays).</p>
<h1>Update #2</h1>
<p>The Roster API now returns Glyphs for each character.</p>
<h1>EDIT #2:</h1>
<p>By request in the comments, here is a Paypal Donate button:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="hidden" name="hosted_button_id" value="FJVPJYYF43VTS"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"/><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2011/01/wow-roster-php-class/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Parsing the WoW Armory without XML &#8211; Part 2</title>
		<link>http://kastang.com/blog/2011/01/parsing-the-wow-armory-without-xml-part-2/</link>
		<comments>http://kastang.com/blog/2011/01/parsing-the-wow-armory-without-xml-part-2/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 02:16:28 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Parsing]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=624</guid>
		<description><![CDATA[This post is a continuation of my original post about parsing the WoW Armory with no XML feeds available. In my original post, I showed how to pull basic character information, such as professions and talents, from each member in a specified guild. This post will expand on more specific character information such as HP, [...]]]></description>
			<content:encoded><![CDATA[<p>This post is a continuation of my <a href="http://kastang.com/blog/2010/12/parsing-the-wow-armory-without-xml/">original post about parsing the WoW Armory with no XML feeds available</a>. In my original post, I showed how to pull basic character information, such as professions and talents, from each member in a specified guild. This post will expand on more specific character information such as HP, MP, and Stats. </p>
<p>The <code>getCharacterInformation($charName)</code> function in my previous post can be expanded to include additional information available on the WoW Armory. (Please view my original post for the sample code). For the most part, the code below can be directly copied into the existing method. As in my previous post, I assume you have the knowledge to make minor changes to the method (such as modifying the return array).  </p>
<p><strong>Exact Health and Mana:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$health</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@class=&quot;health&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mana</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@id=&quot;summary-power&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$health</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$mana</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Exact Talents:</strong><br />
This will return the exact talent in the form of xx/xx/xx for both talents.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$exactBuilds</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//span[@class=&quot;name-build&quot;]/span[@class=&quot;build&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$exactBuilds</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$exactBuilds</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Stats and Resistances:</strong><br />
A stat listed in the comment above the code needs to be added to the <code>$stat</code> variable.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Valid $stat values:
 * strength, agility, stamina, intellect,
 * spirit, mastery, meleedamage, meleedps,
 * meleeattackpower, meleespeed, meleehaste,
 * meleehit, meleecrit, meleecrip, expertise,
 * rangeddamage, rangeddps, rangedattackpower,
 * rangedspeed, rangedhaste, rangedhit, rangedcrit,
 * spellpower, spellhaste, spellhit, spellcrit,
 * spellpenetration, manaregen, combatregen, armor,
 * dodge, parry, block, resilience, arcaneres, fireres,
 * frostres, natureres, shadowres,
 */</span>
&nbsp;
<span style="color: #000088;">$stat</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ADD_STAT_FROM_ABOVE_HERE&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$statName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@data-id=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$stat</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;]/span[@class=&quot;name&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$statValue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@data-id=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$stat</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$statName</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$statValue</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Battleground Rating and Kills</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rating</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@class=&quot;rating&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$kills</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//li[@class=&quot;kills&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$rating</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$kills</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>My next post will cover looking into more interesting character information such as Achievements, Reputation, or Statistics. </p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2011/01/parsing-the-wow-armory-without-xml-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Parsing the WoW Armory without XML</title>
		<link>http://kastang.com/blog/2010/12/parsing-the-wow-armory-without-xml/</link>
		<comments>http://kastang.com/blog/2010/12/parsing-the-wow-armory-without-xml/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 02:16:01 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=602</guid>
		<description><![CDATA[A month or so ago Blizzard moved the WoW Armory to Battle.net servers. Currently, the new WoW Armory does not offer XML feeds for the data.  I spent a few hours working with PHP and DOM to create a 'parser' for the new Armory.  The below script is a trimmed down version of what is [...]]]></description>
			<content:encoded><![CDATA[<p>A month or so ago Blizzard moved the WoW Armory to Battle.net servers. Currently, the new WoW Armory does not offer XML feeds for the data.  I spent a few hours working with PHP and DOM to create a 'parser' for the new Armory.  The below script is a trimmed down version of what is currently being used for the <a href="http://weknow.to/roster/" target="_blank">We Know Roster</a>. I am only providing the back end script that will do the parsing and store the information in a MySQL database. Front end displaying can easily be achieved by querying the database with the stored results.</p>
<p>The script will pull the following information for each member in a specified guild: Name, Level, Class, Rank, Achievement Points, Profession 1 Name+Level, Profession 2 Name+Level, Talent1, and Talent2.</p>
<p>The scripts below require modifications to work properly. I recommend having knowledge of PHP/CLI before working with this script. <strong>I will develop a more user friendly version of this script only if Blizzard does not supply useful XML or JSON feeds in a reasonable amount of time.</strong></p>
<h2>The Bash Script:</h2>
<p>The bash script pulls the newest HTML Roster file from the new Armory. This could probably be pulled via the PHP script, but since the file is several thousand lines long, I found it more efficient to save the file first and read it locally.</p>
<p>Please pay special attention to the paths, they will need to be altered in order to work correctly.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;">#Replace YOUR_GUILD_NAME_HERE with your guild name. If your Guild Name is two or more words, it should be in the format</span>
<span style="color: #666666; font-style: italic;">#of Your%20Guild%20Name</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">--directory-prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>desired<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span> http:<span style="color: #000000; font-weight: bold;">//</span>us.battle.net<span style="color: #000000; font-weight: bold;">/</span>wow<span style="color: #000000; font-weight: bold;">/</span>en<span style="color: #000000; font-weight: bold;">/</span>guild<span style="color: #000000; font-weight: bold;">/</span>YOUR_SERVER_HERE<span style="color: #000000; font-weight: bold;">/</span>YOUR_GUILD_NAME_HERE<span style="color: #000000; font-weight: bold;">/</span>roster
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>desired<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>roster <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>desired<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>roster.html
php <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>file<span style="color: #000000; font-weight: bold;">/</span>ParseRoster.php</pre></div></div>

<h2>The SQL Dump:</h2>
<p>Import this into a MySQL database.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">--</span>
<span style="color: #808080; font-style: italic;">-- Table structure for table `roster`</span>
<span style="color: #808080; font-style: italic;">--</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color: #ff0000;">`roster`</span> <span style="color: #66cc66;">&#40;</span>
  <span style="color: #ff0000;">`id`</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`name`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`race`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`class`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`level`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`rank`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`ap`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`prof1name`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`prof1value`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`prof2name`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`prof2value`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`talent1`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #ff0000;">`talent2`</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
  <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">`id`</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span> ENGINE<span style="color: #66cc66;">=</span>MyISAM  <span style="color: #993333; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #66cc66;">=</span>latin1 <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> ;</pre></div></div>

<h2>The PHP Backend:</h2>
<p>The PHP file should be fairly straight forward.</p>
<p>A few notes:</p>
<ul>
<li>I have a config file that holds information for my database, if you have a similar file you should include it, otherwise add in the proper mysql_connect() information.</li>
<li>Make sure the path to the Roster.html file is correct.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span> ?php
<span style="color: #009933; font-style: italic;">/**
 * This script will parse the new WoW Armory without an XML file.
 * This script will currently pull the Name, Level, Class, Race,
 * Achievement Points, Professions, and Talents of every member
 * In a specified guild. The script works for me but may not work
 * as expected on every system. Use at your own risk.
 *
 * @author Josh Grochowski (josh[dot]kastang[at]gmail[dot]com)
 *
 */</span>
&nbsp;
<span style="color: #990000;">set_time_limit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/path/to/config/file.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
getRosterInformation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> getRosterInformation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000088;">$roster</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/path/to/roster/file/roster.html&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> domDocument<span style="color: #339933;">;</span>
    <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$roster</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">preserveWhiteSpace</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//The first tbody tag marks the start of the actual</span>
    <span style="color: #666666; font-style: italic;">//'roster' part of the html.</span>
    <span style="color: #000088;">$roster</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tbody'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Each Character has its own tr block.</span>
    <span style="color: #000088;">$char</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$roster</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//Character information is split into individual</span>
        <span style="color: #666666; font-style: italic;">//td blocks.</span>
        <span style="color: #000088;">$charInfo</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$charImages</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$c</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'img'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//I only care about active characters. Inactive characters</span>
        <span style="color: #666666; font-style: italic;">//will display 0 Achievement points.</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$charInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
                <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$charInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$race</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$charImages</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'src'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$charImages</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'src'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$level</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$charInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$rank</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$charInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$ap</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$charInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">//Returns an array containing the professions name/level and</span>
                <span style="color: #666666; font-style: italic;">//talents of each individual character.</span>
                <span style="color: #000088;">$charArray</span> <span style="color: #339933;">=</span> getCharacterInformation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO roster(name,race,class,level,rank,ap,prof1name,prof1value,prof2name,prof2value,talent1,talent2)
                                VALUES('<span style="color: #006699; font-weight: bold;">$name</span>','<span style="color: #006699; font-weight: bold;">$race</span>','<span style="color: #006699; font-weight: bold;">$class</span>','<span style="color: #006699; font-weight: bold;">$level</span>','<span style="color: #006699; font-weight: bold;">$rank</span>','<span style="color: #006699; font-weight: bold;">$ap</span>','<span style="color: #006699; font-weight: bold;">$charArray[profName1]</span>','<span style="color: #006699; font-weight: bold;">$charArray[profValue1]</span>',
                                '<span style="color: #006699; font-weight: bold;">$charArray[profName2]</span>','<span style="color: #006699; font-weight: bold;">$charArray[profValue2]</span>','<span style="color: #006699; font-weight: bold;">$charArray[talent1]</span>','<span style="color: #006699; font-weight: bold;">$charArray[talent2]</span>')&quot;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">//Wait 5 seconds inbetween queries to keep from getting banned from WoW Armory servers.</span>
                <span style="color: #666666; font-style: italic;">//This can probably be adjusted to three or four seconds, but if you do get banned, it can</span>
                <span style="color: #666666; font-style: italic;">//last las long as 48 hours.</span>
                <span style="color: #990000;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> getCharacterInformation<span style="color: #009900;">&#40;</span><span style="color: #000088;">$charName</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//link to characters page on WoW Armory</span>
    <span style="color: #000088;">$charInfo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://us.battle.net/wow/en/character/eitrigg/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$charName</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/simple&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> domDocument<span style="color: #339933;">;</span>
    <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$charInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">preserveWhiteSpace</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Profession Names</span>
    <span style="color: #000088;">$xpath</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMXPath<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dom</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$profName</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//span[@class=&quot;profession-details&quot;]/span[@class=&quot;name&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Profession Values</span>
    <span style="color: #000088;">$profValue</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//span[@class=&quot;profession-details&quot;]/span[@class=&quot;value&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//Talents</span>
    <span style="color: #000088;">$talents</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'//span[@class=&quot;name-build&quot;]/span[@class=&quot;name&quot;]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$charArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;profName1&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$profName</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">&quot;profValue1&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$profValue</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">&quot;profName2&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$profName</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">&quot;profValue2&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$profValue</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">&quot;talent1&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$talents</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">&quot;talent2&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$talents</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$charArray</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/12/parsing-the-wow-armory-without-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Configuring WoW on Linux</title>
		<link>http://kastang.com/blog/2010/08/installing-and-configuring-wow-on-linux/</link>
		<comments>http://kastang.com/blog/2010/08/installing-and-configuring-wow-on-linux/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 17:39:46 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[WoW]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=492</guid>
		<description><![CDATA[A few months ago I wrote a blog post answering some frequently asked questions about playing World of Warcraft on Linux (more specifically, on Ubuntu). I am making a return to WoW after an extensive break. During my break I did a fresh install of Ubuntu 10.04. I am in the process of reinstalling WoW [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I wrote a <a href="http://kastang.com/blog/2010/01/wow-on-linux/">blog post</a> answering some frequently asked questions about playing World of Warcraft on Linux (more specifically, on Ubuntu). I am making a return to WoW after an extensive break. During my break I did a fresh install of Ubuntu 10.04. I am in the process of reinstalling WoW on my Ubuntu partition. While reinstalling and reconfiguring WoW for my system, I took a few screenshots and notes. Hopefully they will be helpful for anyone who wants to play WoW on Linux.</p>
<p>This guide is tailored to Ubuntu 10.04 users, but should be similar for any Debian based OS users. I like to think everything is fairly straight forward. I assume you have some sort of basic Linux knowledge before attempting this guide. For example, if you do not know how to navigate around in Terminal, you probably shouldn't try this.</p>
<h2>Prerequisites</h2>
<p>Before installing Wine or WoW a few things need to be done with your system.</p>
<ul>
<li><strong>Update your graphics drivers</strong>: Updating your graphic drivers is probably the most important thing to do to ensure stable performance in WoW. Both NVidia and ATI have made great improvement over the past few years in improving the quality of their Linux drivers. Each release seems to increase the stability and performance of their cards.</li>
<li><strong>Turn off special effects</strong>: If you are using Compiz (or an equivalent) turn it off before trying to play WoW. 9/10 times it will severely diminish performance and cause system lockups. If you use Gnome or KDE, I suggest switching to more lightweight option such as XFCE. This is not mandatory, XFCE my desktop environment of choice. If you want to give XFCE a try, in terminal type: <code>sudo apt-get install xubuntu-desktop</code></li>
</ul>
<h2>Install and Configuring Wine</h2>
<p>Make sure you have the newest version of Wine installed. If you are using Ubuntu, open terminal and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-add-repository ppa:ubuntu-wine<span style="color: #000000; font-weight: bold;">/</span>ppa
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">wine</span></pre></div></div>

<p>The above commands will install the newest version of Wine on your system. At the time of this writing, the newest version is Wine 1.2. After issuing the above commands, type <code>wine --version</code> in Terminal to make sure you have the newest version available. To check the newest version, head over to <a href="http://www.winehq.org/" target="_blank">WineHQ</a> and check the latest Stable Release version.</p>
<p>Generally speaking the newest version of Wine is always the best. Occasionally a bug will occur in a build in which case you will have to manually install a previous version. World of Warcraft is a very well supported game in the Wine community so the chances of such a bug happening are slim.</p>
<p>For now, only one optional change needs to be made in the Wine Configuration. If you are only using a single monitor system, you can probably skip this. If you are using dual (or more) monitors, you should set an emulate desktop. Type <code>winecfg</code> in terminal. Click the Graphics tab, and check the "Emulate a virtual desktop" checkbox. Enter the screen resolution of the monitor you are going to play WoW on under Desktop Size. What this does is create a virtual desktop for Wine programs to run in. This is sometimes needed because certain games may appear distorted or overlap to a second monitor in full screen mode. If you are using Dual Monitors for example, you will need this activated so you can play correctly in full windowed mode and still be able to access your second monitor while playing WoW.</p>
<h2>Installing WoW from Scratch</h2>
<p><em>*If you have WoW installed on a seperate Windows partition you can use it rather then installing from scratch. If you do, ignore the installation instructions below and scroll down to Special Cases at the bottom of this post. </em></p>
<p>After Wine is installed and configured we can start the installation process. This process is pretty straight forward. I am using the WoW Online installer since I do not own the physical WoW discs. You can download the WoW Installer directly from Battle.net <a href="https://www.worldofwarcraft.com/account/download/clients/pc/InstallWoW.exe">here</a>. If this link does not work, login to your Battle.net account and download the Windows version of the WoW Installer.</p>
<p>After the file downloads, open terminal and navigate to the directory where InstallWoW.exe is located and run:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wine</span> InstallWoW.exe</pre></div></div>

<p>If this is your first time using Wine, the process may take a few extra seconds while configuration files are created. Your screen may also flicker a few times, don't worry, its normal. If all goes well, a screen should pop up asking which version of WoW you want to install. Select WoLK. You should see the following screen shortly after:</p>
<div id="attachment_495" class="wp-caption aligncenter" style="width: 476px"><a href="http://kastang.com/blog/wp-content/uploads/2010/08/WoWDownloading.png"><img class="size-full wp-image-495 " title="WoWDownloading" src="http://kastang.com/blog/wp-content/uploads/2010/08/WoWDownloading.png" alt="WoW Downloading" width="466" height="328" /></a><p class="wp-caption-text">WoW Installer downloading the required files to continue. </p></div>
<p>After the required files are done downloading, you may receive an error about some system components failing the minimum requirements. This is most likely due to Ubuntu not reporting the proper system information.  Ignore any such warnings and click Install.</p>
<div id="attachment_498" class="wp-caption aligncenter" style="width: 434px"><a href="http://kastang.com/blog/wp-content/uploads/2010/08/FailMinimumReqs.png"><img class="size-full wp-image-498   " title="FailMinimumReqs" src="http://kastang.com/blog/wp-content/uploads/2010/08/FailMinimumReqs.png" alt="" width="424" height="312" /></a><p class="wp-caption-text">Ignore any failing minimum requirements warnings. </p></div>
<p>Next you will be prompted to select an install location for WoW. I personally chose C:\Program Files inside of Wine. You can safely choose whichever directory you want. For future reference, the "C" drive Wine creates is mapped to <code>~/.wine/drive_c/</code>. In my example, my WoW folder will be: <code>~/.wine/drive_c/Program\ Files/World\ of\ Warcraft/</code></p>
<div id="attachment_501" class="wp-caption aligncenter" style="width: 456px"><a href="http://kastang.com/blog/wp-content/uploads/2010/08/InstallDirectory.png"><img class="size-full wp-image-501 " title="InstallDirectory" src="http://kastang.com/blog/wp-content/uploads/2010/08/InstallDirectory.png" alt="" width="446" height="350" /></a><p class="wp-caption-text">Choosing the WoW Install Directoy. </p></div>
<p>The longest part of the install when 7.5 GB of WoLK files are being downloaded and installed. I am receiving pretty constant speeds from Blizzards servers of around 800-900KB/s with spikes sometimes around 1.5MB/s. The install part will take a few hours to complete. I would recommend getting to this step before bed.</p>
<div id="attachment_503" class="wp-caption aligncenter" style="width: 485px"><a href="http://kastang.com/blog/wp-content/uploads/2010/08/WoLKInstalling.png"><img class="size-full wp-image-503" title="WoLKInstalling" src="http://kastang.com/blog/wp-content/uploads/2010/08/WoLKInstalling.png" alt="" width="475" height="355" /></a><p class="wp-caption-text">WOLK Installing</p></div>
<p>After the base install of WOLK is done, the game will automatically launch the Blizzard updater and patch WoW to the newest version. If all goes well, this should be done automatically, without issue. In my case, Wine froze while updating to Patch 3.3.3. If the game freezes on you during updating, open terminal and type:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">killall</span> wineserver
<span style="color: #c20cb9; font-weight: bold;">wine</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span>Launcher.exe</pre></div></div>

<p>The launcher should re-launch and the game should continue to upload without any issues.</p>
<h2>Configuring WoW</h2>
<p>By now WoW should be installed and fully patched. Before running the game, I recommend editing the Config.wtf file before launching WoW for the first time.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Copy your original Config file to a new location.</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span>WTF<span style="color: #000000; font-weight: bold;">/</span>Config.wtf ~
<span style="color: #666666; font-style: italic;">#Remove the original</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span>WTF<span style="color: #000000; font-weight: bold;">/</span>Config.wtf
<span style="color: #666666; font-style: italic;">#Create a new Config.wtf file and copy the below inside it</span>
<span style="color: #c20cb9; font-weight: bold;">vi</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span>WTF<span style="color: #000000; font-weight: bold;">/</span>Config.wtf</pre></div></div>

<p>This config file sets all of the performance settings to the lowest possible setting(don't worry, you'll adjust these later. Just for the initial launch it makes life easier), sets OpenGL by default, accepts the TOS and EULA, and sets a low screen resolution.<br />
<code><br />
SET readTOS "1"<br />
SET readEULA "1"<br />
SET readScanning "-1"<br />
SET readContest "-1"<br />
SET readTerminationWithoutNotice "-1"<br />
SET installType "Retail"<br />
SET locale "enUS"<br />
SET movie "0"<br />
SET showToolsUI "1"<br />
SET portal "us"<br />
SET realmList "us.logon.worldofwarcraft.com"<br />
SET patchlist "us.version.worldofwarcraft.com"<br />
SET hwDetect "0"<br />
SET gxWindow "1"<br />
SET gxRefresh "60"<br />
SET gxMultisampleQuality "0.000000"<br />
SET gxFixLag "0"<br />
SET videoOptionsVersion "3"<br />
SET textureFilteringMode "0"<br />
SET Gamma "1.000000"<br />
SET Sound_OutputDriverName "System Default"<br />
SET Sound_MusicVolume "0.40000000596046"<br />
SET Sound_AmbienceVolume "0.60000002384186"<br />
SET farclip "177"<br />
SET particleDensity "0.10000000149012"<br />
SET baseMip "1"<br />
SET environmentDetail "0.5"<br />
SET weatherDensity "0"<br />
SET ffxGlow "0"<br />
SET ffxDeath "0"<br />
SET gxResolution "1024x760"<br />
SET gxApi "opengl"<br />
</code></p>
<p>Now you should be good to boot the game for the first time. You should have a WoW Icon on your Desktop. If you do, double click on it and it will launch the WoW screen. If you do not have a WoW Icon on your desktop, enter the following command in terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wine</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span>Wow.exe</pre></div></div>

<p>If you did not have a WoW Icon on your Desktop, look at the bottom of this post to see how to create an Alias to launch WoW through terminal.</p>
<p>From here it is up to you to configure the settings to your liking. I recommend taking it slow, gradually update the settings until you are happy with the performance. Personally speaking, most of my settings are very similar to the settings I would play with in Windows. Both ATI and NVidia Linux drivers have come a long way in recent years. You should not see much a performance loss between playing on Windows or Linux. In some instances, you may even see a performance boost.</p>
<h2>AddOns</h2>
<p>Generally speaking, all AddOns will work fine under Linux. Rather then manually installing my AddOns, I prefer having a program do the manual work for me. One of my favorite programs for such a task is <a href="http://www.wowmatrix.com/" target="_blank">WoWMatrix</a>. As far as I know, WoWMatrix is the only AddOn updater I know that offers a native Linux client.</p>
<p>Download WoWMatrix Linux version from WoWMatrix and execute the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Navigate to where wowmatrix.tar.gz file was downloaded</span>
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf wowmatrix.tar.gz
.<span style="color: #000000; font-weight: bold;">/</span>wowmatrix</pre></div></div>

<p>If all goes well, WoWMatrix should launch and ask where your WoW folder is located. In the window, right click in the white space and click Show Hidden Files. Navigate to ~/.wine/drive_c/Program\ Files/World\ of\ Warcraft/ - After the folder is selected, accept the license agreement. The rest should be self explanatory.</p>
<p>As with configuring your video performance, I recommend gradually adding AddOns. Make sure none cause issues.</p>
<h2>Create a Terminal Alias for WoW</h2>
<p>If for some reason a Desktop icon was not created, or you do not use a windows manager, you can create an alias to launch WoW via Terminal. If you use bash, add this to your <code>~/.bash_aliases</code> file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">wow</span>=<span style="color: #ff0000;">'wine ~/.wine/drive_c/Program\ Files/World\ of\ Warcraft/Wow.exe'</span></pre></div></div>

<p>After changes are made to your aliases file, you will need to apply the changes by typing <code>source ~/.bash_aliases</code> in Terminal. From now on you will be able to type <code>wow</code> in Terminal and the game will execute.</p>
<h2>Special Cases</h2>
<p>Unless you were previously directed to read this section, skip it.</p>
<p><strong>Using an existing WoW Install:</strong></p>
<p>If you already have WoW installed on a Windows partition, you have two options to choose from:</p>
<ul>
<li>Running WoW directly from your Windows partition.</li>
<li>Copying your WoW directory from your Windows partition to your Ubuntu parition.</li>
</ul>
<p>I am assuming you do not have your Windows partition mounted. If this is the case you will first need to know the which partition your Windows is located:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> fdisk <span style="color: #660033;">-l</span>
&nbsp;
   Device Boot      Start         End      Blocks   Id  System
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda1   <span style="color: #000000; font-weight: bold;">*</span>           <span style="color: #000000;">1</span>          <span style="color: #000000;">13</span>      <span style="color: #000000;">102400</span>    <span style="color: #000000;">7</span>  HPFS<span style="color: #000000; font-weight: bold;">/</span>NTFS
Partition <span style="color: #000000;">1</span> does not end on cylinder boundary.
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2              <span style="color: #000000;">13</span>       <span style="color: #000000;">31871</span>   <span style="color: #000000;">255897600</span>    <span style="color: #000000;">7</span>  HPFS<span style="color: #000000; font-weight: bold;">/</span>NTFS
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda3           <span style="color: #000000;">31871</span>       <span style="color: #000000;">44648</span>   <span style="color: #000000;">102631425</span>    <span style="color: #000000;">5</span>  Extended
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda5           <span style="color: #000000;">31871</span>       <span style="color: #000000;">44029</span>    <span style="color: #000000;">97654784</span>   <span style="color: #000000;">83</span>  Linux
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda6           <span style="color: #000000;">44029</span>       <span style="color: #000000;">44527</span>     <span style="color: #000000;">3998720</span>   <span style="color: #000000;">82</span>  Linux swap <span style="color: #000000; font-weight: bold;">/</span> Solaris
<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda7           <span style="color: #000000;">44527</span>       <span style="color: #000000;">44648</span>      <span style="color: #000000;">975872</span>   <span style="color: #000000;">83</span>  Linux</pre></div></div>

<p>Issue the above command. it will display a list off all partitions on your hard drives. Look for the largest NTFS filesystem, this will most likely be your Windows partition. In my case, my Windows partition is located on <code>/dev/sda2</code>.</p>
<p>Now that you know which partition Windows is installed on, execute the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>Windows
<span style="color: #666666; font-style: italic;">#REPLACE /dev/sda2 with your Windows partition.</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda2 <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>Windows</pre></div></div>

<p>This will create a directory for your Windows partition to reside in then mount the partition to the newly created folder.  I recommend you copy your existing WoW install your Ubuntu partition. For consistency, we will move your WoW folder to Wine virtual directories. This is not necessary though, the WoW folder can be placed anywhere on your Ubuntu HD.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>Windows<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>World\ of\ Warcraft<span style="color: #000000; font-weight: bold;">/</span> ~<span style="color: #000000; font-weight: bold;">/</span>.wine<span style="color: #000000; font-weight: bold;">/</span>drive_c<span style="color: #000000; font-weight: bold;">/</span>Program\ Files<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>This will take awhile to complete. I suggest starting the copy and walking away for an hour.</p>
<p>If you choose to use your Windows partition to run WoW instead of copying it to Ubuntu, you should automount your NTFS drive on boot. Look up how to by editing your fstab file. I will not cover this in my guide.</p>
<h2>Conclusion</h2>
<p>If you are at this point, chances are you have a working WoW install. Congratulations!</p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/08/installing-and-configuring-wow-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>World of Warcraft Account Security</title>
		<link>http://kastang.com/blog/2010/01/world-of-warcraft-account-security/</link>
		<comments>http://kastang.com/blog/2010/01/world-of-warcraft-account-security/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 03:28:42 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=286</guid>
		<description><![CDATA[Recently there has been discussions in my Guild regarding World of Warcraft account security. I believe this is a perfect opportunity to give my opinion on measures that I believe must be taken to ensure increased general security of your computer along with your World of Warcraft account. One thing I must make clear is there is no [...]]]></description>
			<content:encoded><![CDATA[<p>Recently there has been discussions in my Guild regarding World of Warcraft account security. I believe this is a perfect opportunity to give my opinion on measures that I believe must be taken to ensure increased general security of your computer along with your World of Warcraft account.</p>
<p>One thing I must make clear is there is no such thing as a completely secure networked computer. The suggestions listed below are simply extra precautions that must be taken to minimize the chance of your computer being compromised.</p>
<p><em>* - Applies to World of Warcraft only.</em></p>
<p><strong>G</strong><strong>et an Authenticator*<br />
<span style="font-weight: normal;">Having an Authenticator will virtually eliminate the chance of your account being compromised. The Blizzard Authenticator costs $6.50 from the <a href="http://us.blizzard.com/store/search.xml?rhtml=y&amp;q=authenticator">Blizzard Store</a>. If you are an iPhone/iTouch user, you can download the <a href="http://itunes.apple.com/us/app/battle-net-mobile-authenticator/id306862897?mt=8">Mobile Authenticator</a> for free. Having an Authenticator is no excuse not to do the remaining suggestions.</span></strong></p>
<p><strong>Web Browser<br />
<span style="font-weight: normal;">Use a secure browser. For the sake of speaking, that pretty much means anything besides Internet Explorer. My personal recommendation is <a href="http://www.google.com/chrome">Google Chrome</a></span><a href="http://www.google.com/chrome"> </a><span style="font-weight: normal;">or <a href="http://getfirefox.com">Firefox</a>. For each, I highly recommend the <a href="https://chrome.google.com/extensions/detail/bhmmomiinigofkjcapegjjndpbikblnp">WOT</a> plugin.</span></strong></p>
<blockquote><p>WOT’s safe browsing tool warns you about risky sites that can’t be trusted: Online shops that cheat customers; download sites that deliver malware; sites that send spam; and those with inappropriate content for kids.</p></blockquote>
<p>Web of Trust provides an additional layer of security when visiting websites. WOT is community managed, meaning if someone spots a phishing website, they can report it. The report is upload to WOT servers, if you try to access the website that has received a poor rating, WOT will block you from going to the website without your express permission. If you use Firefox, in addition to <a href="https://addons.mozilla.org/en-US/firefox/addon/3456">WOT</a>, I also highly suggest <a href="https://addons.mozilla.org/en-US/firefox/addon/722">NoScript</a>. Currently, Google Chrome does not have a  NoScript extension available.</p>
<p><strong>Passwords<br />
<span style="font-weight: normal;">Your World of Warcraft password should be entirely different from any other service you use. Generally speaking, a password should be at least 8 characters long with upper/lower case letters, numbers, and symbols. Your World of Warcraft password (along with other sensitive passwords) should be changed at least once a month. It takes 2 minutes to do, don't be lazy. An example of a good password would be 'I3n&amp;$VW49*'.</span></strong></p>
<p><span style="font-weight: normal;"><strong>Anti-Virus, etc.<br />
<span style="font-weight: normal;">Windows users - Having AV software is not full proof. Consider it just another way to decrease the chances of having malicious software installed on your computer (for a long period of time). I personally recommend <a href="http://avira.com">Avira</a> or <a href="http://eset.com">NOD32</a>. Along with AV software, I also recommend <a href="http://www.safer-networking.org/index2.html">Spybot</a> and <a href="http://www.malwarebytes.org/">Malwarebytes</a> (Free Edition is fine). Malwarebytes is specifically targeted to Malware, harmful software that is generally not picked up by AV software. AV software should be set to automatically update and run daily (Both NOD32 and Avira provide this option, as do many other AV's such as AVG and Avast).  I would recommend running anti-malware software at minimum once a week. </span></strong></span></p>
<p><span style="font-weight: normal;"><strong><span style="font-weight: normal;">For Mac(OSX)/Linux users, The options for security software is rather slim. I can recommend <a href="http://www.clamxav.com/">ClamXav</a>(Mac) and <a href="http://www.clamav.net/">Clamav</a>(Linux) for virus scanning. I also recommend <a href="http://rkhunter.sourceforge.net/">rkhunter</a> for OSX/Linux systems. Generally speaking, there is not much more that can be done for OSX systems in terms of AV software. Sadly, Apple has spread false information on commercials by suggesting OSX is immune to viruses, until OSX suffers a mass attack, it is unlikely much further production of AV software will occur. As for Linux systems, there are other precautions that can be taken, but I will assume if you use Linux, you should know how to properly secure your system.</span></strong></span></p>
<p><span style="font-weight: normal;"><strong><span style="font-weight: normal;">Note: Debian based distrobutions can run the follow command to download rkhunter and clamav:</span></strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clamav rkhunter
<span style="color: #666666; font-style: italic;">#rkhunter -c to run</span>
<span style="color: #666666; font-style: italic;">#clamscan -r in '/' directory to run</span></pre></div></div>

<p><span style="font-weight: normal;"><span style="font-weight: normal;"><strong>Updates<br />
<span style="font-weight: normal;">Windows users - Automatic Updates should be turned on. Keep your system updated at all times. Microsoft is constantly releasing security patches to fix potential vulnerabilities in your system. If you are still using XP (or anything older) update to Windows 7 as soon as possible. When updates for your system become available, do not postpone restarting your computer to take effect, do it immediately when it asks. </span></strong></span></span></p>
<p>OSX users - By Default, OSX will check for System Updates once a week (This setting can be changed in System Preferences -&gt; Software Update). Install updates whenever they are available.</p>
<p>Linux users - If you are using a Debian based system, the following commands can be executed from a Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</pre></div></div>

<p>Other non-Debian based Distributions should consult the proper documentation.</p>
<p><strong>Common Sense<br />
<span style="font-weight: normal;">Be smart when you use your computer. </span> </strong></p>
<p><strong></p>
<ul>
<li><span style="font-weight: normal;">One precaution that should be taken is when reading email. Never click on links masked by anchor tags (HTML), especially World of Warcraft related emails. If you receive an email from Blizzard asking you to log in to your account, or a beta key, it is most likely a scam.</span></li>
<li><span style="font-weight: normal;">When using your laptop on a public network, be very careful to use SSL connections while logging in/reading email or any other services. If you are on a public network, you should always assume that someone is watching and logging everything you do (this includes cleartext logins). For maximum security, I recommend always using hardwired connection wherever possible (this includes on a home network also). </span></li>
<li><span style="font-weight: normal;">If at any point you find your computer acting strange, immediately stop what you are doing, update and run your protection software.</span></li>
<li><span style="font-weight: normal;">If your World of Warcraft account is compromised, and virus scans show up nothing on your computer. Do not assume one is not there. Change the password for your email and WoW account on a different computer, then work on finding out what caused the security breach on your WoW computer. </span></li>
</ul>
<p></strong></p>
<p><span style="font-weight: normal;"><strong>Conclusion<br />
<span style="font-weight: normal;">Everything above may seem like a lot to take in at first, especially if you have little to no protection on your computer to begin with. The hour or two it will take to setup will be well worth it if your World of Warcraft account becomes compromised. Not only will following my suggestions increase the overall security of your system, it will also save you from possible embarrassment if your account becomes compromised. Once you get everything setup, it should not take more then a half hour of manual work per week to keep your system up to date and secure. </span><span style="font-weight: normal;">I will repeat again, having this security software in place will not make your computer full proof against attack. The above software will only minimize the chances of your system becoming compromised.</span></strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/01/world-of-warcraft-account-security/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wintergrasp Tokens &#8211; Possible to Have Over 100</title>
		<link>http://kastang.com/blog/2010/01/wintergrasp-tokens/</link>
		<comments>http://kastang.com/blog/2010/01/wintergrasp-tokens/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 03:32:38 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Wintergrasp]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=278</guid>
		<description><![CDATA[Not sure if this is common knowledge or not, but today I found out it is possible to have more then 100 Wintergrasp Tokens. I assumed the limit was 100 just like all other battlegrounds. After tonights victory in Wintergrasp I noticed that I had 101 tokens. I looked on WowHead to verify, it appears [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure if this is common knowledge or not, but today I found out it is possible to have more then 100 Wintergrasp Tokens. I assumed the limit was 100 just like all other battlegrounds. After tonights victory in Wintergrasp I noticed that I had 101 tokens. I looked on WowHead to verify, it appears the limit for WG tokens is 1000. Makes me wonder if badges will be mailed if someone actually hits the 1000 badge cap.</p>
<p><a href="http://kastang.com/blog/wp-content/uploads/2010/01/WG_Tokens.png"><img class="size-medium wp-image-277 alignnone" title="WG_Tokens" src="http://kastang.com/blog/wp-content/uploads/2010/01/WG_Tokens-228x300.png" alt="" width="228" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/01/wintergrasp-tokens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing the WoW Armory – Part 2.1</title>
		<link>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2-1/</link>
		<comments>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2-1/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 02:16:06 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Armory]]></category>
		<category><![CDATA[Parsing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=266</guid>
		<description><![CDATA[I forgot to post this information in Part 2 of Parsing the WoW Armory. When parsing the guild-info.xml file, some fields are represented by  numerical values. Below is conversion table from XML numerical representations to actual values. genderId: 0 - Male 1 - Female raceId: 1 - Human 2 - Orc 3 - Dwarf 4 [...]]]></description>
			<content:encoded><![CDATA[<p>I forgot to post this information in Part 2 of Parsing the WoW Armory. When parsing the guild-info.xml file, some fields are represented by  numerical values. Below is conversion table from XML numerical representations to actual values.</p>
<p><strong>genderId:</strong><br />
0 - Male<br />
1 - Female</p>
<p><strong>raceId:</strong><br />
1 - Human<br />
2 -  Orc<br />
3 - Dwarf<br />
4 - Night Elf<br />
5 - Undead<br />
6 - Tauren<br />
7 - Gnome<br />
8 - Troll<br />
10 - Blood Elf<br />
11 - Draenei</p>
<p><strong>classId:</strong><br />
1 - Warrior<br />
2 - Paladin<br />
3 - Hunter<br />
4 - Rogue<br />
5 - Priest<br />
6 - Death Knight<br />
7 - Shaman<br />
8 - Mage<br />
9 - Warlock<br />
11 - Druid</p>
<p>For easy converting from numerical to actual values I would recommend using a PHP array(). Below is an example of the Sorted Guild list from Part 2 with the addition of the class of each character included.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000000; font-weight: bold;">function</span> sortedList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$classArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Warrior&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Paladin&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Hunter&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Rogue&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span> <span style="color: #339933;">=&gt;</span> 
          <span style="color: #0000ff;">&quot;Priest&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Death Knight&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">7</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Shaman&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Mage&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">9</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Warlock&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">11</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Druid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> getName<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span>getLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$classArray</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span>getClassId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing the WoW Armory – Part 2</title>
		<link>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2/</link>
		<comments>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 00:50:04 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Armory]]></category>
		<category><![CDATA[Parsing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[World of Warcraft]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=256</guid>
		<description><![CDATA[I chose to expand on Part 1 by providing a function file that provides access to all available character related information from the guild-info.xml file from the WoW Armory. The guild-info.xml file provides the following information for the entire guild: Achievement Points, Class ID, Gender ID, Level, Character Name, Race ID, Guild Rank, URL to [...]]]></description>
			<content:encoded><![CDATA[<p>I chose to expand on Part 1 by providing a function file that provides access to all available character related information from the guild-info.xml file from the WoW Armory. The guild-info.xml file provides the following information for the entire guild: Achievement Points, Class ID, Gender ID, Level, Character Name, Race ID, Guild Rank, URL to Character Page. </p>
<p>Some neat things can be calculated by using the available resources. I provided three examples in the code below: Average achievement points, average level, and a sorted list of all characters in the guild (also provided in Part 1).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
&nbsp;
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;user_agent&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">//Average guild achievement score. </span>
<span style="color: #000000; font-weight: bold;">function</span> achAverage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$total</span> <span style="color: #339933;">+=</span> getAchPoints<span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span><span style="color: #339933;">/</span><span style="color: #000088;">$counter</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Sorted Guild Characters Names/Levels in ABC Order. </span>
<span style="color: #000000; font-weight: bold;">function</span> sortedList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> getName<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span>getLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #990000;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Returns the average level of the entire guild. </span>
<span style="color: #000000; font-weight: bold;">function</span> avgLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$total</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$total</span> <span style="color: #339933;">+=</span> getLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$total</span><span style="color: #339933;">/</span><span style="color: #000088;">$counter</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Other functions that can be used to pull information
 * from the XML sheet. Use these functions to expand
 * and create other functions. 
 **/</span>
<span style="color: #000000; font-weight: bold;">function</span> getAchPoints<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'achPoints'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getClassId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'classId'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getGenderId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'genderId'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getName<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getRaceId<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'raceId'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getRank<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'rank'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> getURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$x</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>New functions can be created by using the get functions at the bottom of the file. Using the get functions and sample functions, it should be easy enough to expand on what I have. </p>
<p>The below code is an example of how to use the function code from above.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #666666; font-style: italic;">//Functions file. </span>
<span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'guild.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Set Server/Guild Here. </span>
<span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Eitrigg&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$guild</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;We+Know&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.wowarmory.com/guild-info.xml?r='</span><span style="color: #339933;">.</span><span style="color: #000088;">$server</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;gn='</span><span style="color: #339933;">.</span><span style="color: #000088;">$guild</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guildInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guild</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">members</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">character</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//-------ABOVE THIS LINE IS REQUIRED----------</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//Below are some possible ways to use the functions. </span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Prints Without Array Numbers **/</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> sortedList<span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/** Alternative Implementation, Prints with Array Numbers
print_r(sortedList($xml));
**/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Displays the average number of guild achievements. </span>
<span style="color: #b1b100;">echo</span> achAverage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Displays the average level of the guild. </span>
<span style="color: #b1b100;">echo</span> avgLevel<span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/01/parsing-the-wow-armory-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing the WoW Armory &#8211; Part 1</title>
		<link>http://kastang.com/blog/2010/01/parsing-the-wow-armory-part-1/</link>
		<comments>http://kastang.com/blog/2010/01/parsing-the-wow-armory-part-1/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 22:17:35 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[WoW]]></category>
		<category><![CDATA[Armory]]></category>
		<category><![CDATA[Parsing PHP]]></category>

		<guid isPermaLink="false">http://kastang.com/?p=234</guid>
		<description><![CDATA[Today I pulled a list of every character in We Know from the WoW Armory in 5 lines of code. &#60; ?PHP ini_set&#40;&#34;user_agent&#34;, &#34;Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8&#34;&#41;; $url='http://www.wowarmory.com/guild-info.xml?r=Eitrigg&#38;gn=We+Know'; $xml = simplexml_load_file&#40;$url&#41;; &#160; foreach&#40;$xml-&#62;guildInfo-&#62;guild-&#62;members-&#62;character as $char&#41; echo $char&#91;'name'&#93;.&#34; - &#34;.$char&#91;'level'&#93;.&#34;&#60;br /&#62;&#34;; ?&#62; I never realized how easy is was [...]]]></description>
			<content:encoded><![CDATA[<p>Today I pulled a list of every character in We Know from the WoW Armory in 5 lines of code.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?PHP
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;user_agent&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.wowarmory.com/guild-info.xml?r=Eitrigg&amp;gn=We+Know'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guildInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guild</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">members</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">character</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>I never realized how easy is was to pull information from the WoW Armory until now. My method has its obvious flaws, such as the output is in no obvious order. I modified my original script to sort the list in ABC order and added a $server and $guild variable to allow for easy modification. Below is a more refined version, in under 15 lines of code the pulled list is sorted in ABC order and displayed.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?PHP
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;user_agent&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.2) Gecko/20121223 Ubuntu/9.25 (jaunty) Firefox/3.8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Eitrigg&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$guild</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;We+Know&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$url</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'http://www.wowarmory.com/guild-info.xml?r='</span><span style="color: #339933;">.</span><span style="color: #000088;">$server</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;gn='</span><span style="color: #339933;">.</span><span style="color: #000088;">$guild</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guildInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">guild</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">members</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">character</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span>
        <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; - &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'level'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">sort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This script is just a quick and dirty way to accomplish the simple task of pulling names from the WoW Armory. I would recommend against using this in a production environment without some sort of cache/database option implemented.</p>
]]></content:encoded>
			<wfw:commentRss>http://kastang.com/blog/2010/01/parsing-the-wow-armory-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

