PHPackages                             johnroyer/crawler-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. johnroyer/crawler-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

johnroyer/crawler-php
=====================

crawler implement in PHP

0.3.6(2y ago)365[3 issues](https://github.com/johnroyer/crawler-php/issues)MITPHPPHP ^8.1|^8.2

Since Sep 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/johnroyer/crawler-php)[ Packagist](https://packagist.org/packages/johnroyer/crawler-php)[ RSS](/packages/johnroyer-crawler-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (16)Used By (0)

Introduction
------------

[](#introduction)

Web crawler in simple.

**Note**: this is a site project. Do NOT use in production.

Usage
-----

[](#usage)

Create handler from `AbstractHandler`, and set domain which handler should handles:

```
class MyHandler extends \Zeroplex\Crawler\Handler\AbstractHandler
{
    public function getDomain(): string
    {
        return 'test.com';
    }

    public function shouldFetch(\Psr\Http\Message\RequestInterface $request): bool
    {
        if (1 === preg_match('/(css|js|jpg|png|gif)$/', $request->getUri())) {
            // ignore css, js and common images
            return false;
        }
        return true;
    }

    public function handle(\Psr\Http\Message\ResponseInterface $response): void
    {
        // get content using $response->getBody()->getContents()
    }
}
```

Then setup crawler and run:

```
$crawler = new \Zeroplex\Crawler\Crawler();

$crawler->setDelay(0)
    ->setTimeout(3)
    ->setFollowRedirect(true)
    ->setUserAgent('Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/100.1');

$crawler->addHandler(new BlogHandler());

// URL to start
$crawler->run('https://test.com');
```

Extends
-------

[](#extends)

For example, implement URL queue by Predis.

composer install:

```
composer require predis/predis
```

Implement `UrlQueueInterface`:

```
class RedisQueue implements Zeroplex\Crawler\UrlQueue\UrlQueueInterface
{
    private $redis;
    public function __construct(string $host, int $port) { }

    public function push(string $url): void
    {
        $this->redis->lpush($url);
    }

    public function pop(): string
    {
        return $this->redis->lpop();
    }

    // and so on
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~77 days

Total

13

Last Release

829d ago

PHP version history (3 changes)0.0.1PHP ^7.4|^8.0

0.0.2PHP ^8.0|^8.1|^8.2

0.3.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/134a7921f61f2b847c6f81e18d0cea923d1b877e2d86ff4f4322a99c4642c147?d=identicon)[johnroyer](/maintainers/johnroyer)

---

Top Contributors

[![johnroyer](https://avatars.githubusercontent.com/u/114491?v=4)](https://github.com/johnroyer "johnroyer (366 commits)")

---

Tags

crawlerphp

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/johnroyer-crawler-php/health.svg)

```
[![Health](https://phpackages.com/badges/johnroyer-crawler-php/health.svg)](https://phpackages.com/packages/johnroyer-crawler-php)
```

###  Alternatives

[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
