Nexun.6932:

Since I see others posting their solutions here, I thought I’d share the PHP (5.3+) wrapper I developed over the course of bank holiday Monday:

https://github.com/jamesmcfadden/PhpGw2Api

I’ve added a simple example here which I plan to improve when I have some more spare time:

http://www.gw2dashboard.net

Thanks for looking!

yakobu.4183:

Nice, is it possible to set the cache lifetime to different time spans depending on the data cached?

Nexun.6932:

Nice, is it possible to set the cache lifetime to different time spans depending on the data cached?

Not currently, but that’s something I’ll certainly look into implementing next.

Thanks for the feedback!

Zies.8142:

Thanks for providing this. I would have had no idea how to do all that myself.

I did spot a tiny error in Service.php.

public function getMatchDetails(array $parameters)
	{
		if(!array_key_exists('match_id', $parameters)) {
			throw new \Exception('match_id is required');
		}
		return $this->_processRequest(self::MATCH_URI, $parameters);
	}

MATCH_URI -> MATCH_DETAIL_URI

Was wondering a while why the output was looking so weird :)

Nexun.6932:

Thanks for providing this. I would have had no idea how to do all that myself.

I did spot a tiny error in Service.php.

public function getMatchDetails(array $parameters)
	{
		if(!array_key_exists('match_id', $parameters)) {
			throw new \Exception('match_id is required');
		}
		return $this->_processRequest(self::MATCH_URI, $parameters);
	}

MATCH_URI -> MATCH_DETAIL_URI

Was wondering a while why the output was looking so weird

Hmm, not sure how that one slipped through I’ve fixed and pushed to the repository.

Thanks for your feedback!

Nexun.6932:

I’ve update the wrapper so it’s now possible to to specify cache lifetimes on a per request basis!

Nexun.6932:

WvW examples:
http://www.gw2dashboard.net/wvw

Still in development but wanted to push it out early

MrsAngelD.6971:

I wish I was a coder, I have no idea how to utilize this

Nexun.6932:

I wish I was a coder, I have no idea how to utilize this

Have you any experience with PHP at all? If not the easiest way to get an environment setup (assuming you’re on Windows) is probably with a package such as WAMP (http://www.wampserver.com/en/) or XAMPP (http://www.apachefriends.org/en/xampp.html). These packages install PHP and a local Apache server for you to serve PHP scripts via your web browser. There are loads of tutorials around the web to help, try http://www.simplehelp.net/2008/08/25/how-to-install-and-setup-apache-mysql-and-php-in-windows/

As for the API wrapper itself there is some (brief) documentation on the GitHub page.

Rawrfaec.6412:

If you’re on Windows the fastest way to get started is almost surely with The Uniform Server, which doesn’t even require installation.

Nexun.6932:

If you’re on Windows the fastest way to get started is almost surely with The Uniform Server, which doesn’t even require installation.

I’ve either never come across this, or completely forgot about it, thanks for the tip!

In other news, I’ve updated the wrapper to support the latest API changes; namely the guild_details, build and color requests.

Updates and other bug fixes are few and far between as I’m out of the country for a while.

Nexun.6932:

I love how the API is evolving – I’ve just updated the wrapper to support the continents, maps and map_floor APIs.

klaufel.4178:

I created this simple but very useful wordpress plugin using the SDK PhpGw2Api (https://github.com/jamesmcfadden/PhpGw2Api)

Thanks Nexum! great job!!

Guild Wars 2 – WvW Matchups (Plugin for Wordpress)

  • Plugin for WordPress, to display the live scores of WvW matchups in Guild Wars 2.

Plugin URL: http://wordpress.org/plugins/guild-wars-2-wvw-matchups/

Nexun.6932:

I created this simple but very useful wordpress plugin using the SDK PhpGw2Api (https://github.com/jamesmcfadden/PhpGw2Api)

Thanks Nexum! great job!!

Guild Wars 2 – WvW Matchups (Plugin for Wordpress)

  • Plugin for WordPress, to display the live scores of WvW matchups in Guild Wars 2.

Plugin URL: http://wordpress.org/plugins/guild-wars-2-wvw-matchups/

I’ve just tried the plugin out on my local machine – great work, really simple to get working! I’m glad you found the wrapper useful

Just a quick note – I couldn’t download the plugin from your website (had to go directly to the Wordpress plugin site).

Thanks again!

thebigredone.1269:

Very nice work, since someone already did WordPress I might just do Drupal when I have the time.

Nexun.6932:

Just thought I’d drop a note to say I’ve updated the wrapper to support the new files API

anzenketh.3759:

I am using the Php-Gw2-Api wrapper. It currently only works on one request. So doing the initial pull is slow. I was trying to find a way to speed it up.

I was reading:
https://forum-en.guildwars2.com/forum/community/api/Add-item-names-Item-Recipe-responses/first#post2063524

Doing some research I found curl-multi-exec may preform the actions that I want. However I am having a hard time Modifying the code for Php-Gw2-Api to make multiple pull requests.

Looking for some help.

Nexun.6932:

I am using the Php-Gw2-Api wrapper. It currently only works on one request. So doing the initial pull is slow. I was trying to find a way to speed it up.

I was reading:
https://forum-en.guildwars2.com/forum/community/api/Add-item-names-Item-Recipe-responses/first#post2063524

Doing some research I found curl-multi-exec may preform the actions that I want. However I am having a hard time Modifying the code for Php-Gw2-Api to make multiple pull requests.

Looking for some help.

Sorry for the late response, I’ve been out of the country with no Internet access for the past week.

I’m going to try and get on later or tomorrow to look into adding support for this. In the meantime if anyone else wants to, feel free to submit a pull request to anzenketh’s open issue here

Thanks

Nexun.6932:

I’ve just updated the wrapper to support HTTP pipelining:

https://github.com/jamesmcfadden/Php-Gw2-Api#parallel-requests

What this means is that you may now make multiple requests in parallel, rather than sequentially (which is much faster!). I haven’t had much time to test this update so all feedback is appreciated!

Thanks