Showing Highly Rated Posts By smiley.1438:

New Page bug - infracted?

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

@OP:

just create a “repair post” next time, pointing out that the pagination is still broken and link to the existing threads:

https://forum-en.gw2archive.eu/forum/support/forum/Thread-loaded-as-Empty/first#post2149426
https://forum-en.gw2archive.eu/forum/support/forum/No-posts-in-a-thread/first#post2693455

GW2's Mumble Link "context" data format

in API Development

Posted by: smiley.1438

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)?

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

Also:

Not to speak of the overhead XML has compared to JSON.

[API Suggestion] Maps API

in API Development

Posted by: smiley.1438

smiley.1438

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

Map API / Mumble Mashup

in API Development

Posted by: smiley.1438

smiley.1438

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! )

how to query all ids at once?

in API Development

Posted by: smiley.1438

smiley.1438

(edited by smiley.1438)

Looks like some of the API is broken...

in API Development

Posted by: smiley.1438

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...
}

How frequently is it OK to access the API?

in API Development

Posted by: smiley.1438

smiley.1438

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)

Print API error messages with PHP

in API Development

Posted by: smiley.1438

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#L130

Thank 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)

Order of ids returned, v2/commerce/listings

in API Development

Posted by: smiley.1438

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.

Proposal: Enemy API

in API Development

Posted by: smiley.1438

smiley.1438

A creature API. I like that idea. There you go: https://github.com/arenanet/api-cdi

[API Suggestion] Colors API

in API Development

Posted by: smiley.1438

smiley.1438

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)