2017 © Pedro Peláez
 

library giphy-php

A library implementing access to the Giphy API.

image

rfreebern/giphy-php

A library implementing access to the Giphy API.

  • Sunday, March 25, 2018
  • by rfreebern
  • Repository
  • 1 Watchers
  • 9 Stars
  • 9,057 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

PHP interface to the Giphy API

A library providing a PHP interface to the Giphy API., (*1)

Installation

composer require rfreebern/giphy-php

Example

There is a file named giphy in the bin directory. Use it like this:, (*2)

$ ./bin/giphy whiskey

GIF Usage

$giphy = new \rfreebern\Giphy();
$result = $giphy->random('whiskey');
print $result->data->image_original_url;

By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:, (*3)

$giphy = new \rfreebern\Giphy($my_giphy_api_key);

In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments., (*4)

search($query, $limit = 25, $offset = 0)

Searches for gifs matching $query., (*5)

getByID($id)

Fetches a specific GIF by its Giphy ID., (*6)

getByIDs(array $ids)

Fetches one or more specific GIFs by their Giphy IDs., (*7)

translate($query)

Translates a query to a matching GIF. See the docs for more information., (*8)

random($tag = null)

Fetches a random GIF, optionally matching the given tag., (*9)

trending($limit = 25)

Fetches a list of trending GIFs., (*10)

Sticker Usage

$sticker = new \rfreebern\Sticker();
$result = $sticker->random('whiskey');
print $result->data->image_original_url;

By default, the constructor uses the shared beta API key, but if you have a key of your own you can pass it as an argument:, (*11)

$giphy = new \rfreebern\Giphy($my_giphy_api_key);

In general, the methods in the Giphy class reflect the endpoints of the Giphy API, and take the same arguments., (*12)

search($query, $limit = 25, $offset = 0)

Searches for stickers matching $query., (*13)

translate($query)

Translates a query to a matching sticker. See the docs for more information., (*14)

random($tag = null)

Fetches a random sticker, optionally matching the given tag., (*15)

trending($limit = 25)

Fetches a list of trending stickers., (*16)

Credits

  • This library was created by Ryan Freebern / @rfreebern.

The Versions

25/03 2018

dev-master

9999999-dev

A library implementing access to the Giphy API.

  Sources   Download

CC0 CC0-1.0

search gif giphy images gifs