PHP code example of repat / spatie-crawler-redis
1. Go to this page and download the library: Download repat/spatie-crawler-redis 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/ */
repat / spatie-crawler-redis example snippets
use Repat\CrawlQueue\RedisCrawlQueue;
// see https://github.com/nrk/predis for options
$options = [
'database' => 7,
];
$prefix = uniqid() . ':'; // same as passing no prefix
$redisClient = new \Predis\Client($options);
// ...
->setCrawlQueue(new RedisCrawlQueue($redisClient, $prefix))
// uses new \Predis\Client without options
->setCrawlQueue(new RedisCrawlQueue())