ok here goes...
The following is my simple block of code to access World of Warcraft's Armory. I want it to access the character named "Ikith" on the server "Bleeding Hollow" and for now print all HTML into a text file.
Instead, it spits out the following, never getting close to the information I need.
Clearly I need to communicate some browser information with the server first before the requested information is handed to me. So I did some searching and found that I need to relay my language preference as "English" and the browser info needs to be formatted like "'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2". (Mozilla is the only example I could find. How could I alter this to view safari's or ie7's?)
So how do I communicate this to the server with my web request? If it matters, I'm in a critical time crunch for Monday that has a LOT to do with the success of the program lol.
The following is my simple block of code to access World of Warcraft's Armory. I want it to access the character named "Ikith" on the server "Bleeding Hollow" and for now print all HTML into a text file.
VB.NET:
Private Sub btnLoadCharArmory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoadCharArmory.Click
Dim sLog As String = My.Application.Info.DirectoryPath & "\armorytest.txt"
Dim oLog As New StreamWriter(sLog)
Dim request As WebRequest = WebRequest.Create("http://www.wowarmory.com/character-sheet.xml?r=Bleeding+Hollow&n=Ikith")
Dim response As WebResponse = request.GetResponse()
Dim reader As StreamReader = New StreamReader(response.GetResponseStream())
Dim str As String = reader.ReadLine()
Do While str.Length > 0
str = reader.ReadLine()
oLog.WriteLine(str)
Loop
oLog.Close()
End Sub
Instead, it spits out the following, never getting close to the information I need.
HTML:
<html>
<head>
<link href="/favicon.ico" rel="shortcut icon">
<title>The World of Warcraft Armory</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="The World of Warcraft Armory is a vast searchable database of information for World of Warcraft - taken straight from the real servers. It is the most comprehensive and up-to-date database on the characters, arena teams, guilds, items, and faction rewards of World of Warcraft in existence." name="description">
<style media="screen, projection" type="text/css">
@import "/_css/master.css";
@import "/shared/global/menu/topnav/topnav.css";
@import "/_css/int.css";
@import "/_css/_lang/en_us/language.css";
@import "/_css/_region/us/region.css";
</style>
<script src="/shared/global/third-party/jquery/jquery.js" type="text/javascript"></script><script src="/shared/global/third-party/jquery/datefunctions.js" type="text/javascript"></script><script src="/shared/global/third-party/jquery/jquery.datepicker.js" type="text/javascript"></script><script src="/shared/global/third-party/jquery/jquery.tablesorter.min.js" type="text/javascript"></script><script src="/shared/global/third-party/jquery/jquery.tablesorter.pager.js" type="text/javascript"></script><script src="/shared/global/third-party/jquery/jquery.bgiframe.min.js" type="text/javascript"></script><script src="/shared/global/third-party/sarissa/0.9.9.3/sarissa.js" type="text/javascript"></script><script src="/_js/common.js" type="text/javascript"></script><script src="/_js/armory.js" type="text/javascript"></script><script type="text/javascript">
/* */
if(Browser.iphone && Number(getcookie2("mobIntPageVisits")) < 3 && getcookie2("hasSeenMobInt") == ""){
setcookie("mobIntPageOrigin",window.location.href,"session");
window.location.href = "/mobile-armory-splash.xml";
}
/* */
</script><script type="text/javascript">
//browser detection
if($.browser.msie){
if($.browser.version == "7.0") addStylesheet('/_css/browser/ie7.css');
if($.browser.version == "6.0") addStylesheet('/_css/browser/ie.css');
}else if($.browser.mozilla){
if(parseFloat($.browser.version) <= 1.9) addStylesheet('/_css/browser/firefox2.css');
}else if($.browser.opera) addStylesheet('/_css/browser/opera.css');
else if($.browser.safari) addStylesheet('/_css/browser/safari.css');
Clearly I need to communicate some browser information with the server first before the requested information is handed to me. So I did some searching and found that I need to relay my language preference as "English" and the browser info needs to be formatted like "'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2". (Mozilla is the only example I could find. How could I alter this to view safari's or ie7's?)
So how do I communicate this to the server with my web request? If it matters, I'm in a critical time crunch for Monday that has a LOT to do with the success of the program lol.
Last edited: