Skip to content

A minimalist and efficient way to Communicate to Imgur API

Notifications You must be signed in to change notification settings

ofahel/Minimalist-Imgur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

PHP Imgur API

A efficient way to Imgur API

oFahel

⚡ Features

  • Asynchronous upload process.
  • Upload images via Binary file, Base64 or URL.
  • Upload video up to 200mb.
  • Convert uploaded video to GIF.

🎉 Installation/Usage

Download the imgur.php and put it on your project folder.

Basic example

<?php
include("imgur.php");

//Instantiate the library passing your Client-ID
$Imgur = new IMGURClass('your_client_id_here');

//Upload a URL
$upload = $Imgur->upload('https://i.imgur.com/hSyuS32.png');

// ----- Get upload infos ----- //

//Direct link
$upload_link = $upload->link;

//File MIME
$upload_mime = $upload->type;

//Image size
$upload_size = array(
  "width" => $upload->width,
  "height" => $upload->height
);

//Dont forget to store the Deletation Hash
$deletation_hash = $upload->deletehash;

//Delete image
$Imgur->delete($deletation_hash);

?>

📄 Class methods

Method Description Parameters
delete Delete a uploaded image/video Deletation Hash
upload Upload a image/video Data(Binary file, Base64 or URL), Async(boolean), Options(Array)

Development

Want to contribute? Great! You are welcome 🥳

License

GNU General Public License

About

A minimalist and efficient way to Communicate to Imgur API

Topics

Resources

Stars

Watchers

Forks

Languages