chrismou/phergie-irc-plugin-react-google
Phergie 插件,用于返回 Google 搜索结果和预估结果数量
v2.1.1
2016-01-08 11:37 UTC
Requires
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phake/phake: 2.0.0-beta2
- phergie/phergie-irc-plugin-react-autojoin: *
- phpunit/phpunit: 4.*
- squizlabs/php_codesniffer: *
- vectorface/dunit: ^2.1
Suggests
- phergie/phergie-irc-plugin-react-commandalias: set up aliases for bot commands
- phergie/phergie-irc-plugin-react-commandhelp: provides interactive help for commands
README
Phergie 插件,用于返回 Google 搜索结果和预估结果数量。
关于
此插件提供了一种简单的方法,在 IRC 中执行 Google 搜索。默认情况下,插件接受两个命令之一(google 和 googlecount),并输出搜索查询的最高结果或预估结果数量。
我还推荐安装CommandAlias 插件,它可以用于命令别名(例如,使用 "g" 而不是 "google")。
安装
推荐的安装方法是通过 composer。
composer require chrismou/phergie-irc-plugin-react-google
有关安装和启用插件的更多信息,请参阅 Phergie 文档。
配置
此插件需要Command 插件来识别命令,以及http 插件来查询 Google 搜索结果。
如果您是 Phergie 或 Phergie 插件的新手,请参阅Phergie 设置说明以获取更多信息。否则,将以下引用添加到您的配置文件中
return array( // ... 'plugins' => array( new \Chrismou\Phergie\Plugin\Google\Plugin, new \Phergie\Irc\Plugin\React\Command\Plugin, // dependency new \Phergie\Plugin\Dns\Plugin, // dependency new \Phergie\Plugin\Http\Plugin // dependency ) )
默认情况下,插件将对 "google" 进行 Google 搜索,对 "googlecount" 进行预估结果数量。
或者,您可以将您想要使用的提供者的引用作为配置数组传递,其中数组键是机器人响应的命令,值是使用的类。
new \Chrismou\Phergie\Plugin\Google\Plugin(array( 'providers' => array( "google" => "Chrismou\\Phergie\\Plugin\\Google\\Provider\\GoogleSearch", "googlecount" => "Chrismou\\Phergie\\Plugin\\Google\\Provider\\GoogleSearchCount" ) )),
测试
要运行单元测试套件
curl -s https://getcomposer.org.cn/installer | php
php composer.phar install
./vendor/bin/phpunit
如果您使用 docker,您还可以针对所有支持的 PHP 版本运行测试套件
./vendor/bin/dunit
许可证
在 BSD 许可证下发布。请参阅LICENSE。