chrismou/phergie-irc-plugin-react-audioscrobbler

Phergie plugin for returning the current or last played song for a user on last.fm or libre.fm

v2.1.0 2016-01-02 00:08 UTC

This package is auto-updated.

Last update: 2024-12-12 04:17:37 UTC


README

Phergie plugin for returning the current or last played song for a user on last.fm or libre.fm.

Build Status Test Coverage Code Climate Buy me a beer

About

Phergie plugin for returning the current or last played song for a user on last.fm or libre.fm. By default, the plugin responds to the commands "lastfm username" and "librefm username" (without the quotes).

Install

The recommended method of installation is through composer.

composer require chrismou/phergie-irc-plugin-react-audioscrobbler

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

Configuration

For last.fm lookups, you need a free API key which you can get from here. LibreFM works out of the box.

new \Chrismou\Phergie\Plugin\Audioscrobbler\Plugin(array(
    'lastfm' => 'YOUR_API_KEY'
))

CommandHelp compatibility

The plugin activates lastfm when it sees you've included a lastfm config, so in order to get CommandHelp to show the plugin in it's command list , you'll need to pass a mock value:

new \Phergie\Irc\Plugin\React\CommandHelp\Plugin(array(
    'plugins' => array(
        new \Chrismou\Phergie\Plugin\Audioscrobbler\Plugin(array(
            'lastfm' => true
        )),
    )
))

Adding this line to your CommandHelp config should force the lastfm command to be displayed.

Tests

To run the unit test suite:

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

If you use docker, you can also run the test suite against all supported PHP versions:

./vendor/bin/dunit

License

Released under the BSD License. See LICENSE.