Coder Social home page Coder Social logo

gw2api's Introduction

gw2api

This is a very basic and simple PHP client implementation for the official Guild Wars 2 API. Somewhen around the 15th of May, 2013, ArenaNet announced the official Guild Wars 2 API, offering developers to create services based on the official RESTful interface to the Guild Wars 2 world.

Getting started

To run the API on your local development on http://localhost/ just follow these 4 simple steps:

  1. Copy or extract the API client to your webserver directory.
  2. Copy ./config-dist.php to ./config.php and fill in the values (Just 2 values: API endpoint and version)
  3. Create a ./cache directory and chmod it to 777
  4. Open http://localhost/test.php in your browser

This should result in the following:

  1. 4 cache files (*.json) should reside in your cache folder
  2. The website in the browser should display all events in my homeworld (Riverside [DE]), their regional occurrence and their status

Now, go and develop some more, have fun!

Demo

I set up a small demo on my own website, showing all events from Riverside [DE] with a cache update of 15 minutes.

Troubleshooting

There's not much troubleshooting at the moment. Your PHP installation will require allow_url_fopen set to On and your localhost should be able to request resources from the internet. If you get cache write errors, you should check whether the read/write settings for the ./cache directory are correctly set to 777.

Important note

Though not required to run the API client, I have included a simple but solid filesystem caching mechanism, writing the JSON response to local files, to save bandwidth and both, yours as well ArenaNet's resources. Please use caching (especially while developing). Read the phpdoc comments to learn about the cache's requirements.

Disclaimer

I am a former Guild Wars 2 player, playing very rarely now. But I love the open web and especially open APIs. I just put together these simple libraries to help other developers get into more serious API development. I am not sure whether I'll find the time to take this project to next levels, but I will keep you informed here. Feel free to fork this library and make it your own. In fact, it's all ArenaNet's work and we can have fun thanks to them!

However, here's the official API terms of use: These API's are wholly owned by ArenaNet, LLC ("ArenaNet"). Any use of the API's must comply with the Website Terms of Use and Content Terms of Use, however you may use the API's to make commercial products so long as they are otherwise compliant and do not compete with ArenaNet. ArenaNet may revoke your right to use the API's at any time. In addition, ArenaNet may create and/or amend any terms or conditions applicable to the API's or their use at any time and from time to time. You understand and agree that ArenaNet is in the process of developing a full license agreement for these API's and ArenaNet will publish it when it is complete. Your continued use of the API's constitutes acceptance of the full license agreement and any related terms or conditions when they are posted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.