(edited by Nexun.6932)
PHP 5.3+ API Wrapper (examples)
Nice, is it possible to set the cache lifetime to different time spans depending on the data cached?
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!
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 :)
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!
I’ve update the wrapper so it’s now possible to to specify cache lifetimes on a per request basis!
WvW examples:
http://www.gw2dashboard.net/wvw
Still in development but wanted to push it out early
(edited by Nexun.6932)
I wish I was a coder, I have no idea how to utilize this
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.
If you’re on Windows the fastest way to get started is almost surely with The Uniform Server, which doesn’t even require installation.
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.
I love how the API is evolving – I’ve just updated the wrapper to support the continents, maps and map_floor APIs.
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 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!
Very nice work, since someone already did WordPress I might just do Drupal when I have the time.
Just thought I’d drop a note to say I’ve updated the wrapper to support the new files API
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.gw2archive.eu/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.
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.gw2archive.eu/forum/community/api/Add-item-names-Item-Recipe-responses/first#post2063524Doing 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
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