PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Andrej Pincik  >  PHP Convert Video to GIF Gfycat API  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file.
Class: PHP Convert Video to GIF Gfycat API
Convert videos and animated GIF using Gfycat API
Author: By
Last change: comment for autoloading files edit.
Date: 5 years ago
Size: 951 bytes
 

 

Contents

Class file image Download
//require all classes or use autoloader

$url = "/images/userpics/5c0sjmle1p.gif";
$UID = "1424708519";
       
$gfycat = GfycatService::getInstance();
$gfycat->setUrl($url)
       ->setUniqueString($UID);
       
$result = $gfycat->getFetchedGifInfo(); //returns all information about data.

        /* $gfycat->isTaskComplete(); //returns boolean if conversion is complete
                  $gfycat->getFetchedGifName(); //returns name of converted file
                  $gfycat->getFetchedGifId(); //returns fetched gif ID
                  $gfycat->getFetchedGifDimension(); //return array (width => '', height => '')
                  $gfycat->getFetchedGifFramerate(); //return framerate string (number)
                  $gfycat->getFetchedGifUrls(); //returns URL for gif, webm and mp4 files. array (webmUrl => '', mp4Url => '', gifUrl => '')
                  $gfycat->fetchData(); //send data to convert, if already converted returns array(already_fetched => TRUE, gfyName => String)
        */