JSON Item API for PTR Items

100 Night Elf Druid
13235
Is there any chance of being able to query items from the PTR using the Blizzard API Item?

Or does anyone have ptr.wowhead.com XML to JSON converter already coded?
Reply Quote
100 Night Elf Hunter
12550
we cannot access ptr items on the api only live items and profiles as for wowhead xml use xmltoarray then encode json ...
Reply Quote
100 Night Elf Hunter
12550
or

function Parse ($url) {

$fileContents= file_get_contents($url);

$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);

$fileContents = trim(str_replace('"', "'", $fileContents));

$simpleXml = simplexml_load_string($fileContents);

$json = json_encode($simpleXml);

return $json;

}
Reply Quote
100 Night Elf Druid
13235
Thanks for the reply, but I wasn't specifically interested in how-to do it, just if anyone had an existing application that mirrors the Blizzard JSON API for PTR items. The JSON format is so much nicer than the barf that the Wowhead "XML API" spits out.

Here is a very early release of my Wowhead PTR -> Blizzard JSON API translator:
http://raffy.antistupid.com/wow/wowhead.php?id=95032
http://ptr.wowhead.com/item=95032

Once I get more features implemented, I'll make it cache the results, but for the time being, don't use this URL for anything other than checking out the example, since some requests require me to pull multiple Wowhead pages to scrape the proper information.

Edit: this now has support for most items and has a cache to avoid spamming ptr.wowhead.com. You can navigate to an overview of the cached items by dropping the query string:
http://raffy.antistupid.com/wow/wowhead.php

I also added support for "uniqueInfo" which indicates Unique-Equipped information, which is currently missing from the Blizzard API.
Edited by Edgy on 2/16/2013 9:12 PM PST
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)
Submit Cancel

Reported!

[Close]