Giter Club home page Giter Club logo

wowhead-api's Introduction

Wowhead-API

PHP library for turning Wowhead pages into useful data

Wowhead is the best source of WoW data; The Battlenet API has promise, but is lacking in many places and Blizzard is not actively working on it.

However, Wowhead does not offer an API. There is a defacto API through the XML item pages, but there are so many other aspects to the Wowhead database. This library presents a sensible API, achieved by screen-scraping the HTML pages. Over time, it will stop working as they change their pages. I'll endeavour to keep updating it.

Usage

$cfg = array(
    'http_timeout' => 5,
);
include('lib_http.php');
include('lib_json.php');
include('lib_wowhead.php');

$ret = wowhead_achievement(2537);

# outputs "Mountain o' Mounts is worth 10 points"
echo "{$ret['name']} is worth {$ret['points']} points\n";

If you're using Flamework, just drop lib_wowhead.php into your include folder.

Functions always return a hash with an ok key, in the Flamework style.

Functions

$ret = wowhead_achievement($id); # Achievement data
$ret = wowhead_quest_cats(); # Quest categories & sub-categories
$ret = wowhead_recipes($profession); # Recipes

More to come...

Tests

You'll need a recent copy of Perl to run the tests:

prove --exec 'php' t/*.t

wowhead-api's People

Contributors

iamcal avatar

Watchers

James Cloos avatar Nathan Chambers avatar

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.