PHPackages                             phergie/phergie-irc-plugin-react-url - 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. phergie/phergie-irc-plugin-react-url

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

phergie/phergie-irc-plugin-react-url
====================================

Phergie plugin for displaying information about URLs

4.0.0(7y ago)08254[3 issues](https://github.com/phergie/phergie-irc-plugin-react-url/issues)6MITPHPPHP ^5.6|^7.0

Since Jan 6Pushed 6y ago3 watchersCompare

[ Source](https://github.com/phergie/phergie-irc-plugin-react-url)[ Packagist](https://packagist.org/packages/phergie/phergie-irc-plugin-react-url)[ RSS](/packages/phergie-phergie-irc-plugin-react-url/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (15)Versions (12)Used By (6)

This project is abandoned
=========================

[](#this-project-is-abandoned)

This repo is being kept for posterity and will be archived in a readonly state. If you're interested it can be forked under a new Composer namespace/GitHub organization.

Url Plugin
==========

[](#url-plugin)

[Phergie](http://github.com/phergie/phergie-irc-bot-react/) plugin for Display URL information about links.

[![Build Status](https://camo.githubusercontent.com/ec31c95ef5c5d5b04e6ef5206d25d1302319667110ed4b1648f5af2133ae0ec7/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f706865726769652f706865726769652d6972632d706c7567696e2d72656163742d75726c2e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/phergie/phergie-irc-plugin-react-url)

Install
-------

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.

```
composer require phergie/phergie-irc-plugin-react-url

```

See Phergie documentation for more information on [installing and enabling plugins](https://github.com/phergie/phergie-irc-bot-react/wiki/Usage#plugins).

Configuration
-------------

[](#configuration)

```
return array(

    'plugins' => array(

        // dependencies
        new \Phergie\Plugin\Dns\Plugin, // Handles DNS lookups for the HTTP plugin
        new \Phergie\Plugin\Http\Plugin, // Handles the HTTP requests for this plugin

        // configuration
        new \Phergie\Irc\Plugin\React\Url\Plugin(array(
            // All configuration is optional

            'hostUrlEmitsOnly' => false, // url.host.(all|) emits only, no further URL handling / shortening

            // or

            'handler' => new \Phergie\Irc\Plugin\React\Url\DefaultUrlHandler(), // URL handler that creates a formatted message based on the URL

            // or

            'shortenTimeout' => 15 // If after this amount of seconds no url shortener has come up with a short URL the normal URL will be used. (Not in effect when there are no shorteners listening.)

            // or

            'filter' => null // Any valid filter implementing Phergie\Irc\Plugin\React\EventFilter\FilterInterface to filter which messages should be handled

        )),

    )
);
```

Events
------

[](#events)

This plugin emits the following generic, do what ever you want with it, events.

- `url.host.HOSTNAME` For example `url.host.twitter.com` (`www.` is stripped from the hostname).
- `url.host.all` For all hostnames.

This plugins also emits two events for url shortening. Only called when there are listeners registered. Each event emit is passed a `UrlshorteningEvent`, if a shortener resolved short url it calls the `resolve` method on the promise.

- `url.shorten.HOSTNAME` For example `url.shorten.twitter.com` (`www.` is stripped from the hostname).
- `url.shorten.all` For all hostnames.

Placeholders
------------

[](#placeholders)

The following placeholders can be used to compose a message that is passed as the first argument for `DefaultUrlHandler` to create custom messages:

- `%url%` - Full URL
- `%url-short%` - Shortened URL
- `%http-status-code%` - HTTP status code
- `%timing%` - Time in seconds it took for th request to complete
- `%timing2%` - Time in seconds it took for th request to complete rounded off to a maximum of two decimals
- `%response-time%` - Time in seconds it took for th request to complete
- `%response-time2%` - Time in seconds it took for th request to complete rounded off to a maximum of two decimals
- `%title%` - Page title
- `%composed-title%` - Page title

### Header Placeholders

[](#header-placeholders)

Selection of response headers from: [en.wikipedia.org/wiki/List\_of\_HTTP\_header\_fields#Response\_Headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_Headers)

- `%header-age%`
- `%header-content-type%`
- `%header-content-length%`
- `%header-content-language%`
- `%header-date%`
- `%header-etag%`
- `%header-expires%`
- `%header-last-modified%`
- `%header-server%`
- `%header-x-powered-by%`

UrlSectionFilter
----------------

[](#urlsectionfilter)

This plugin comes with the `UrlSectionFilter` that lets you filter on the different key value pairs coming out of [`parse_url`](http://php.net/parse_url). The following example filter allows `www.phergie.org`, `www2.phergie.org`, and `phergie.org`:

```
new OrFilter([
    new UrlSectionFilter('host', '*.phergie.org'),
    new UrlSectionFilter('host', 'phergie.org'),
])
```

The filter comes with a third `strict` parameter where instead of declaring out of scope on missing an URL part it return `false`.

Tests
-----

[](#tests)

To run the unit test suite:

```
curl -s https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit

```

License
-------

[](#license)

Released under the MIT License. See `LICENSE`.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~171 days

Recently: every ~264 days

Total

9

Last Release

2776d ago

Major Versions

1.0.1 → 2.0.02015-11-16

1.0.2 → 2.0.12015-12-11

2.0.1 → 3.0.02015-12-31

3.1.0 → 4.0.02018-10-08

PHP version history (3 changes)1.0.1PHP &gt;=5.4.0

3.0.0PHP ^5.5|^7.0

4.0.0PHP ^5.6|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/80dec604abed1b21daafc54c430468444a2ad163ad5f8229348b8d241b797778?d=identicon)[elazar](/maintainers/elazar)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (176 commits)")[![svpernova09](https://avatars.githubusercontent.com/u/967362?v=4)](https://github.com/svpernova09 "svpernova09 (13 commits)")[![elazar](https://avatars.githubusercontent.com/u/15487?v=4)](https://github.com/elazar "elazar (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![matthewtrask](https://avatars.githubusercontent.com/u/4731244?v=4)](https://github.com/matthewtrask "matthewtrask (2 commits)")[![PSchwisow](https://avatars.githubusercontent.com/u/1644414?v=4)](https://github.com/PSchwisow "PSchwisow (1 commits)")[![Meroje](https://avatars.githubusercontent.com/u/304101?v=4)](https://github.com/Meroje "Meroje (1 commits)")[![clue](https://avatars.githubusercontent.com/u/776829?v=4)](https://github.com/clue "clue (1 commits)")[![sitedyno](https://avatars.githubusercontent.com/u/216721?v=4)](https://github.com/sitedyno "sitedyno (1 commits)")

---

Tags

pluginbotreactirc

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/phergie-phergie-irc-plugin-react-url/health.svg)

```
[![Health](https://phpackages.com/badges/phergie-phergie-irc-plugin-react-url/health.svg)](https://phpackages.com/packages/phergie-phergie-irc-plugin-react-url)
```

PHPackages © 2026

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