PHP code example of pschwisow / phergie-irc-plugin-react-url-shorten

1. Go to this page and download the library: Download pschwisow/phergie-irc-plugin-react-url-shorten 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/ */

    

pschwisow / phergie-irc-plugin-react-url-shorten example snippets


return [
    'plugins' => [
        // 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
        new \Phergie\Irc\Plugin\React\Url\Plugin([
            'handler' => new \Phergie\Irc\Plugin\React\Url\DefaultUrlHandler('[%url-short%] %composed-title%')
        ]), // Emits url.shorten.* events

        // configuration
        new \PSchwisow\Phergie\Plugin\UrlShorten\Plugin([
            // All configuration is optional

            // Specify the classname of the shortener adapter
            'service' => 'Gscio', // FQCN or relative to PSchwisow\Phergie\Plugin\UrlShorten\Adapter

            // Override adapter's minimum length to attempt to shorten
            'minimumLength' => 15,

            // Add to list of hosts to skip shortening (presumably because they are already shortened)
            'skipHosts' => ['abc.com', 'xyz.net']

            // Disable the default list of hosts to skip shortening
            'disableDefaultSkipHosts' => true
        ])
    ]
];

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