Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1916 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

World Of Warcraft XML

Thread title: World Of Warcraft XML
Closed Thread    
    Thread tools Search this thread Display Modes  
03-08-2007, 06:22 PM
#1
IAmThomas is offline IAmThomas
Status: I'm new around here
Join date: Mar 2007
Location:
Expertise:
Software:
 
Posts: 1
iTrader: 0 / 0%
 

IAmThomas is on a distinguished road

  Old  World Of Warcraft XML

OK, so WoW launched the Armory so I was tried to do something with PHP.

http://armory.wow-europe.com/charact...enor&n=Trigguh
When you view the source, it shows you alot of XML information about the char.

When I get PHP to get the contents of that address, and echo them out. The source is completely different.

http://www.thomas.uk.to/wow

Is there any other way to get the XML Data thats in the Source with PHP?

03-08-2007, 07:30 PM
#2
sketchie is offline sketchie
sketchie's Avatar
Status: Senior Member
Join date: Jul 2005
Location:
Expertise:
Software:
 
Posts: 835
iTrader: 1 / 100%
 

sketchie is on a distinguished road

  Old

That page doesn't appears to be good ol' xhtml to me, not an xml page.

I've never messed around with xml in php to be fair but if it is possible to get html out, you'll notice in the source of WoW's site, things such as style sheets are not linked with the full path, as you don't have the style sheet stored locally (I prosume) it won't show up on your page!

Code:
if (is_ie7)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/ie7.css" />');

if (is_ie6 && !is_ie7)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/ie.css" />');
	
if (is_opera)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/opera.css" />');
	
if (is_opera && is_mac)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/opera-mac.css" />');

if (is_safari)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/safari.css" />');

if (is_mac)
    document.write('<link rel="stylesheet" type="text/css" media="screen, projection" href="css/mac.css" />');

03-22-2007, 05:53 PM
#3
Xlorep DarkHelm is offline Xlorep DarkHelm
Status: I'm new around here
Join date: Mar 2007
Location:
Expertise:
Software:
 
Posts: 2
iTrader: 0 / 0%
 

Xlorep DarkHelm is on a distinguished road

  Old

I too am trying to get the XML source, rather than the xhtml transitional code that the Armory seems to send. I want to be able to use it with PHP, and I've unsuccessfully figured out how to pull out the XML document without the translation, which both IE and Firefox seem to be capable of doing.

03-26-2007, 10:49 PM
#4
Xlorep DarkHelm is offline Xlorep DarkHelm
Status: I'm new around here
Join date: Mar 2007
Location:
Expertise:
Software:
 
Posts: 2
iTrader: 0 / 0%
 

Xlorep DarkHelm is on a distinguished road

  Old

I figured it out. you have to set the user agent to something it likes, so adding the line:

PHP Code:
ini_set('user_agent',"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2"); 
before you actually request the XML file will trick the armory system into believing you are using one of the more advanced, modern browsers (in this case, Mozilla FireFox). Then you will get XML rather than the XHTML Transitional code from their server.

Case in point, my sidebar on my personal website (http://darkhelm.org) has a section listing my WoW characters, done through PHP, using the data straight from the armory.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed