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
Requires
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phake/phake: 2.0.0-beta2
- phergie/phergie-irc-plugin-react-autojoin: ~2
- phpunit/phpunit: 4.*
- squizlabs/php_codesniffer: *
- vectorface/dunit: ^2.1
Suggests
- phergie/phergie-irc-plugin-react-commandhelp: provides interactive help for commands
README
Phergie plugin for returning the current or last played song for a user on last.fm or libre.fm.
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
.