Last active
August 12, 2021 01:03
-
-
Save symisc/bd820c4d9a510b38c2aef7f265dd517d to your computer and use it in GitHub Desktop.
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
# Draw some funny text on TOP & BOTTOM of the famous Michael Jordan crying face. | |
# https://pixlab.io/cmd?id=drawtext is the target endpoint for drawing text | |
# Michael Jordan Crying face | |
$img = 'https://pixlab.io/images/jdr.jpg'; | |
# Your PixLab API Key | |
$key = 'PIXLAB_API_KEY'; # Get yours from https://pixlab.io/dashboard | |
/* Process */ | |
$pix = new Pixlab($key); | |
if( !$pix->get('drawtext',array( | |
'img' => $img, | |
'top' => 'someone bumps the table', | |
'bottom' => 'right before you win', | |
'cap' => true, # Capitalize text, | |
'strokecolor' => 'black' | |
)) ){ | |
echo $pix->get_error_message()."\n"; | |
die; | |
} | |
echo "Pic Link: ".$pix->json->ssl_link."\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment