LF Help: wowhead XML parser
Good day everyone.
I am SQL developer in real life (guild leader and affliction warlock in game if anyone cares), mostly work with SyBase products, have very little experience with C/C++ and close to no experience with PHP (assembled few pages using CMS's) and there is one thing regarding World of Warcraft that I would like to develop (or maybe there is one already but I can't find it): an application that would download items from wowhead.com servers to a local computer, in XML or JSON or similar format, but again I have close to no experience with web services or any other kind of http parsing, however on this forum I found a few programs that are able to do that like Simulationcraft and OptiGear, there are even source codes, but they are way to complicated to try to understand them by myself, so I am asking for help of elitist jerks community members.
For beginning I want very simple thing, a c/c++/php or any similar programing language procedure/function that would save info like http://www.wowhead.com/item=49623&xml to a local variable/file.
UPDATE: It looks I did it using php:
Anyone any ideas how to reach similar result in c/c++? and maybe someone knows how to get multilpe items from wowhead.com, not single one, like Armor - Items - World of Warcraft? Any help would be appreciated.
P.S. Sorry for my bad English, I am not a native speaker.
P.S.S. Sorry, wrong forum, this should be in Public Discussion threat, would be great if someone could move it there.
All the info you need is in the json fields. You have to parse it out.
Doing this from C++ is non-trivial. You need a package to manage the http protocol and a package to parse the XML.
However, downloading public libraries for these functions is a bit like pushing in a thumb-tack with a sledgehammer.
In SimC I elected to implement the http protocol for posix platforms and wrap the windows utility. I also elected to write a super-simple xml parser/interrogator. Feel free to start from sc_http.cpp and sc_xml.cpp. Simply remove usage of the sim_t, threading, caching, and whats left over is pretty small.
Thanks for reply, but I am afraid your code is too complicated for me, I know only basics of c++, very early basics...
As of using PHP:
For enchants and reforging we have static arrays to translate the encoding.
For the socket bonus we parse the tool-tip.
|All times are GMT -4. The time now is 7:20 PM.|
Forum Infrastructure by vBulletin 3.6.12 ©2000-2007, Jelsoft Enterprises Ltd.