All Projects → amalfra → Giantbomb

amalfra / Giantbomb

Licence: mit
A PHP wrapper for GiantBomb API

Labels

Projects that are alternatives of or similar to Giantbomb

Flapigen Rs
Tool for connecting programs or libraries written in Rust with other languages
Stars: ✭ 473 (+9360%)
Mutual labels:  wrapper
Highcharter
R wrapper for highcharts
Stars: ✭ 583 (+11560%)
Mutual labels:  wrapper
Pykaldi
A Python wrapper for Kaldi
Stars: ✭ 756 (+15020%)
Mutual labels:  wrapper
Materialdrawerkt
A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.
Stars: ✭ 508 (+10060%)
Mutual labels:  wrapper
Python Poloniex
Poloniex API wrapper for Python 2.7 & 3
Stars: ✭ 557 (+11040%)
Mutual labels:  wrapper
Ofxcv
Alternative approach to interfacing with OpenCv from openFrameworks.
Stars: ✭ 614 (+12180%)
Mutual labels:  wrapper
Seq2seqchatbots
A wrapper around tensor2tensor to flexibly train, interact, and generate data for neural chatbots.
Stars: ✭ 466 (+9220%)
Mutual labels:  wrapper
Kodirpc
Kodi JSON-RPC API/v6 Wrapper in C#
Stars: ✭ 5 (+0%)
Mutual labels:  wrapper
Atlassian Python Api
Atlassian Python REST API wrapper
Stars: ✭ 564 (+11180%)
Mutual labels:  wrapper
Gorocksdb
gorocksdb is a Go wrapper for RocksDB
Stars: ✭ 753 (+14960%)
Mutual labels:  wrapper
Rxfirebase
Rxjava 2.0 wrapper on Google's Android Firebase library.
Stars: ✭ 509 (+10080%)
Mutual labels:  wrapper
Qtsharp
Mono/.NET bindings for Qt
Stars: ✭ 532 (+10540%)
Mutual labels:  wrapper
Imgkit
🌁 Wkhtmltoimage python wrapper to convert HTML to image
Stars: ✭ 620 (+12300%)
Mutual labels:  wrapper
Imgui Go
Go wrapper library for "Dear ImGui" (https://github.com/ocornut/imgui)
Stars: ✭ 499 (+9880%)
Mutual labels:  wrapper
Scintillanet
A Windows Forms control, wrapper, and bindings for the Scintilla text editor.
Stars: ✭ 781 (+15520%)
Mutual labels:  wrapper
Goffmpeg
FFMPEG wrapper written in GO
Stars: ✭ 469 (+9280%)
Mutual labels:  wrapper
Ruby Tesseract Ocr
A Ruby wrapper library to the tesseract-ocr API.
Stars: ✭ 601 (+11920%)
Mutual labels:  wrapper
Tensorflow.jl
A Julia wrapper for TensorFlow
Stars: ✭ 822 (+16340%)
Mutual labels:  wrapper
Moyasar Php
Moyasar PHP client library
Stars: ✭ 5 (+0%)
Mutual labels:  wrapper
Inkwell
It's a New Kind of Wrapper for Exposing LLVM (Safely)
Stars: ✭ 732 (+14540%)
Mutual labels:  wrapper

PHP wrapper for Giantbomb API

GitHub release

A library for easy interaction with Giantbomb API. Features are:

  • PSR-4 autoloading support
  • Caching support

Get your API Key at http://api.giantbomb.com

Requirements

  • PHP >= 7.0
  • PHP Redis extension

Installation

via Composer

$ composer require giantbomb/giantbomb

This will create a vendor directory (if you dont already have one) and set up the autoloading classmap.

Usage

Once everything is installed, you should be able to load the composer autoloader in your code.

You can load the wrapper classes using namespace as:

require __DIR__ . '/vendor/autoload.php';

use GiantBomb\GiantBomb;

Now create a new object

$gb_obj = new GiantBomb('YOUR_KEY');

Now the available API methods can be called using the instance. All the result from API will be returned as an object. If any status code other than 200 is returned an exception would be thrown.

Currently Available Methods

  • game(game_id, field_list)
  • games(filter, limit, offset, platform, sort, field_list)
  • review(review_id, field_list)
  • game_rating(rating_id, field_list)
  • company(company_id, field_list)
  • character(character_id, field_list)
  • search(query, field_list, limit, page, resources)
  • genres(field_list, limit, offset)
  • platforms(field_list, limit, offset, filter, sort)

Cache

You can configure caching to prevent hitting API if same queries are made again. Currently supported caching methods are:

  • inmemory: cache will be stored in memory array. This won't be persisted after your script exits.
  • redis: cache will be stored in redis store which can be configured.

Cache can be configured using setCacheProvider method of GiantBomb instance. If it's not configured caching will be disabled and API will always be hit each time a method is called. setCacheProvider method accepts two parameter:

  1. [required] cache type eg: inmemory, redis etc
  2. [optional] an associative array in which additional configuration details required for setting up the cache method can be given eg: redis server host and port values

using inmemory cache method

This method does not need any additional configuration option than just activating by calling setCacheProvider method with inmemory as first parameter. eg:

$gb_obj->setCacheProvider('inmemory');

using redis cache method

This method can be activated by calling setCacheProvider method with redis as first parameter. You will also need to specify redis server host and port as second parameter. eg:

$gb_obj->setCacheProvider('redis', array('host' => 'localhost', 'port' => 6379));

Development

Questions, problems or suggestions? Please post them on the issue tracker.

You can contribute changes by forking the project and submitting a pull request. Feel free to contribute 😍

UNDER MIT LICENSE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].