Created
January 10, 2012 13:58
-
-
Save fabn/1589218 to your computer and use it in GitHub Desktop.
How to retrieve a previously submitted job
This file contains 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 | |
try { | |
$webthumb = new Bluga_Webthumb(); | |
$webthumb->setApiKey($APIKEY); | |
$job = $webthumb->addUrl($url,'medium2', 1024, 768); | |
$job->options->notify = "Your notify url"; | |
$webthumb->submitRequests(); | |
// save the job to retrieve it later | |
file_put_contents('/tmp/thumbjob.txt', serialize($job)); | |
// later in the notified scripts | |
$theJob = unserialize(file_get_contents('/tmp/thumbjob.txt')); | |
$webthumb = new Bluga_Webthumb(); | |
$webthumb->setApiKey($APIKEY); | |
$webthumb->addJob($job); | |
$webthumb->fetchToFile($job, '/tmp/image.png'); | |
} catch (Exception $e) { | |
var_dump($e->getMessage()); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment