dev-master
9999999-dev https://github.com/awelters/hatebaseHatebase is a PHP HTTP client library for consuming the Hatebase API
MIT
The Requires
- php >=5.3.3
- ext-curl *
api curl hatebase
Hatebase is a PHP HTTP client library for consuming the Hatebase API
Simple PHP wrapper for v3.0 of the hatebase.org API, (*1)
{ "require": { "awelters/hatebase": "dev-master" } }
<?php /** * Andrew's Hatebase script : Simple script to retrieve results from Hatebase API * * @category Awesomeness * @date 3/03/2014 * @author Andrew Welters <awelters@hugmehugyou.org> * @license http://opensource.org/licenses/MIT The MIT License * @link http://www.hatebase.org/connect_api * @link https://github.com/awelters/hatebase */ ini_set('display_errors', 1); header('Content-type: application/json'); require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload use Hatebase\HatebaseAPI; $settings = array( 'key' => '', 'version' => '3' //optional ); $hatebase = new HatebaseAPI($settings); //See http://www.hatebase.org/connect_api for filter options $filters = array('about_nationality' => '1', 'language' => 'eng'); $output = 'json'; //either 'xml' or 'json', 'xml' is faster $query_type = 'sightings'; //either 'vocabulary' or 'sightings' try { $result = $hatebase->performRequest($filters, $output, $query_type); print_r($result); } catch(Exception $e) { echo 'Error: '.$e; }
Hatebase is a PHP HTTP client library for consuming the Hatebase API
MIT
api curl hatebase