Showing Highly Rated Posts By smiley.1438:
Now that the world/map display in friendlist etc. have been fixed, any chance that this will be also fixed for the mumble link data? I still receive “garbage” values when in WvW like 2147483655 for RoF borderland and 3221225491 for the EoTM instance i’ve been. Can’t you just return the actual home world id for players in WvW and overflows (e.g. 2005 in my case)?
Also:
Not to speak of the overhead XML has compared to JSON.
Nothing prevents you from datamining as long as it isn’t reverse engineering of the actual game files aka gw2.dat which in fact would be against the EULA
Hey, some of you might be also interested in this:
http://overwolf.uservoice.com/forums/235154-feature-requests/suggestions/5262764-mumble-integration
(in other words: vote for it!
)
See this thread: https://forum-en.gw2archive.eu/forum/community/api/PHP-SQL-script-takes-9hrs-to-complete-db/4472325
I think there was also a Python implementation around, but i can’t find it anymore.
€:
There it is: https://forum-en.gw2archive.eu/forum/community/api/v2-item-details-and-recipe-details/4436181
(edited by smiley.1438)
I built a quick array table for anyone using PHP.
https://github.com/codemasher/gw2api-tools/blob/master/json/gw2_worlds.json
$worlds = json_decode(file_get_contents('gw2_worlds.json'), true);
foreach($worlds as $w){
// do stuff...
}
Cliff answered this more than once before and stated that there’s no specific limit but it would be good when we’d cache the results when possible.
See: https://forum-en.gw2archive.eu/forum/community/api/How-often-is-the-event-data-updated/first#post2063497
and
https://forum-en.gw2archive.eu/forum/community/api/names-json-static/first#post2064473
(edited by smiley.1438)
It seems that file_get_contents() fails as soon as it gets the HTTP/403 and doesn’t receive the content.
The function returns the read data or FALSE on failure.
Try using cURL instead.
See: https://github.com/codemasher/gw2-database/blob/master/classes/gw2api.class.php#L130Thank you, I have been using cURL to no avail but after looking at your link noticed some missing constants, and a ‘CA root certificate file’ that was needed to .. make the SSL work? I don’t know much about that, but I’m happy with the results. The working code is the following:
$url = “https://api.guildwars2.com/v2/characters”;
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_CAINFO => getcwd().“\cacert.pem”,
CURLOPT_RETURNTRANSFER => true]);
$output = curl_exec($ch);
curl_close($ch);
echo $output;I got the certificate from here http://curl.haxx.se/ca/cacert.pem
Thanks for your guidance, this was driving me nuts.
The missing variables are all in the code i linked, along with a link to the root certificates (which are indeed needed to “make SSL work”)
https://github.com/codemasher/gw2-database/blob/master/classes/gw2api.class.php#L65
Glad you found it anyway and it worked for you!
You can check if $data returns null.
It won’t return null. Ever. It will return a boolean false or a string containing the response (which may be empty) – that makes a slight difference.
(edited by smiley.1438)
Thats the reason why i’d prefer the results indexed by their id instead of having the id as actual value.
{
"item_id": {
"key1": "value1"
...
},
...
}
Would actually save a lot hassle since you could directly access the objects and the order wouldn’t matter at all. (I’ve suggested that more than once…). Also, the identifier is passed as key to functions like JQuerys $.each() or prototype’s Enumerable.each() or could be as well used in foreach() loops in several C-like languages, so i wonder why this suboptimal response format was chosen.
A creature API. I like that idea. There you go: https://github.com/arenanet/api-cdi
Would it be possible to assign the color tone and materials for each color to colors.json?
126: {
name: "Hot Pink",
tone: "red", //red, orange, yellow, green, blue, purple, brown, gray
set: "rare", //starter, common, uncommon, rare, special
material: "vibrant",//vibrant, natural leather, natural metallic
base_rgb: [128,26,26],
cloth: {
...
},
...
},
(edited by smiley.1438)