Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

phergie/phergie-irc-plugin-react-youtube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

phergie/phergie-irc-plugin-react-youtube

Phergie plugin for providing information about YouTube videos.

Build Status

Install

The recommended method of installation is through composer.

{
    "require": {
        "phergie/phergie-irc-plugin-react-youtube": "~2"
    }
}

See Phergie documentation for more information on installing and enabling plugins.

Configuration

return array(

    'plugins' => array(

        // dependencies
        new \WyriHaximus\Phergie\Plugin\Dns\Plugin,
        new \WyriHaximus\Phergie\Plugin\Http\Plugin,
        new \WyriHaximus\Phergie\Plugin\Url\Plugin,

        new \Phergie\Irc\Plugin\React\YouTube\Plugin(array(

            // required: Google API key
            'key' => 'YOUR_KEY_GOES_HERE',

            // optional: pattern used to format video data before sending it
            'responseFormat' =>
                    '[ %link% ] "%title%" by %author%'
                    . '; Length %duration%'
                    . '; Published %published%'
                    . '; Views %views%'
                    . '; Likes %likes%',

            // optional: date format used for video publish timestamps
            'publishedFormat' => 'n/j/y g:i A',

            // optional: interval format used for video durations
            'durationFormat' => '%im%ss',

        )),

    )
);

Markers supported in responseFormat:

  • %link%
  • %title%
  • %author%
  • %published%
  • %views%
  • %likes%
  • %dislikes%
  • %favorites%
  • %comments%
  • %duration%

How to get a Google API key

Format used by publishedFormat

Format used by durationFormat

Tests

To run the unit test suite:

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

License

Released under the BSD License. See LICENSE.