nehalvpatel / gfycat-php
A PHP interface to the Gfycat API.
Installs: 6 063
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 3
Open Issues: 1
Requires
- guzzlehttp/guzzle: ^6.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: 1.*
This package is not auto-updated.
Last update: 2025-01-18 17:04:39 UTC
README
A PHP interface to the Gfycat API.
Installation
Add the package to your composer file:
composer require nehalvpatel/gfycat-php "^2.0"
composer update
Example
require 'vendor/autoload.php'; use nehalvpatel\Gfycat; // convert a gif from a Url print_r(Gfycat::convertUrl("http://i.imgur.com/gTv0isU.gif")); // convert a gif from a Url and release (async upload, check status using query()) Gfycat::convertUrlAndRelease("http://i.imgur.com/gTv0isU.gif"); //// -> returns gfycat key if gif hasn't already been uploaded to gfycat //// -> returns array of gfy data if the gif has been converted before // convert a gif from a file $file = // stream of data (fopen() or an instance of a Psr\Http\Message\StreamInterface) print_r(Gfycat::convertFile($file); // query a gfy name for urls and more information print_r(Gfycat::query("SpryFixedGnu")); // check if a URL has already been converted print_r(Gfycat::check("http://i.imgur.com/gTv0isU.gif"));
Contribution
Run tests before creating a pull request: vendor/bin/phpunit
.