Download the PHP package phergie/phergie-irc-plugin-react-url without Composer
On this page you can find all versions of the php package phergie/phergie-irc-plugin-react-url. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package phergie-irc-plugin-react-url
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
Phergie plugin for Display URL information about links.
Install
To install via Composer, use the command below, it will automatically detect the latest version and bind it with ~
.
See Phergie documentation for more information on installing and enabling plugins.
Configuration
Events
This plugin emits the following generic, do what ever you want with it, events.
url.host.HOSTNAME
For exampleurl.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 exampleurl.shorten.twitter.com
(www.
is stripped from the hostname).url.shorten.all
For all hostnames.
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
Selection of response headers from: 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
This plugin comes with the UrlSectionFilter
that lets you filter on the different key value pairs coming out of parse_url
. The following example filter allows www.phergie.org
, www2.phergie.org
, and 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
To run the unit test suite:
License
Released under the MIT License. See LICENSE
.
All versions of phergie-irc-plugin-react-url with dependencies
phergie/phergie-irc-bot-react Version ~2
nojimage/twitter-text-php Version ~2.0
phergie/phergie-irc-plugin-http Version ^4.0
react/promise Version ~1.0|~2.0
phergie/phergie-irc-plugin-react-eventfilter Version ^1.0||^2.0