PHP code example of shutterstock / presto
1. Go to this page and download the library: Download shutterstock/presto library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
shutterstock / presto example snippets
$request = new Shutterstock\Presto\Presto();
$r = $request->get('http://www.google.com');
Shutterstock\Presto\Presto::initQueue();
// callback function to process response
$rest_response = function($r) {
if ($r->is_success) {
echo "{$r->http_code} - {$r->url} " . round($r->total_time, 2) . "s\n";
} else {
echo "0 - {$r->url} {$r->error}\n";
}
};
// URLs to hit, );
$requests[$url]->queue_enabled = true;
$requests[$url]->get($url, null, $rest_response);
}
// Process all queued requests
Shutterstock\Presto\Presto::processQueue();