This is functions to grab the data off of armory and load the item id's into an array to do with as you please.
Example Use
Code:
Dim tArray() As String = LoadArmoryInfo("http://www.wowarmory.com/character-sheet.xml?r=Rexxar&n=Glitchyg")
For Each tString As String In tArray
MsgBox(tString)
Next
Imports
Code:
Imports System.Xml
Imports System.Net
Imports System.IO
Functions
Code:
Public Function LoadArmoryInfo(ByVal tURL As String) As String()
Dim tString, tChrData(0) As String
Dim tCount, tData, tSlot As Integer
tString = GetHtml(tURL)
If Strings.StrComp(tString, "-1") = 0 Then
'Error
Return tChrData
End If
Dim m_nodelist As XmlNodeList
Dim m_xmld As XmlDocument
Dim m_node As XmlNode
m_xmld = New XmlDocument()
m_xmld.LoadXml(tString)
m_nodelist = m_xmld.SelectNodes("/page/characterInfo/characterTab/items/item")
tCount = 0
For Each m_node In m_nodelist
tData = m_node.Attributes.GetNamedItem("id").Value
tSlot = m_node.Attributes.GetNamedItem("slot").Value
If tSlot = -1 Then
tSlot = 19
End If
ReDim Preserve tChrData(tCount)
tChrData(tSlot) = tData
tCount = tCount + 1
Next
Return tChrData
End Function
Public Function GetHtml(ByVal URL As String) As String
Try
Dim request As HttpWebRequest = WebRequest.Create(URL)
request.UserAgent = "Firefox/2."
Application.DoEvents()
Dim response As HttpWebResponse = request.GetResponse()
Application.DoEvents()
Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
Dim tString As String
tString = ""
Do While Not reader.EndOfStream()
tString = tString & reader.ReadLine() & vbCrLf
Loop
Return tString
Catch ex As WebException
'Unable to Connect to Host
Return -1
Catch ex As UriFormatException
'Invaild URL
Return -1
Catch ex As Exception
'Unknown Error
Return -1
End Try
End Function