Phergie plugin for returning the current or last played song for a user on last.fm or libre.fm (https://github.com/phergie/phergie-irc-bot-react)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.codeclimate.yml
.dunitconfig
.gitattributes
.gitignore
.scrutinizer.yml
.travis.yml
CONTRIBUTING.md
Gruntfile.js
LICENSE
README.md
composer.json
package.json
phpunit.xml

README.md

Last.fm / Libre.fm plugin for Phergie

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.