Class: SearchPlugin
- Inherits:
-
CrazyDoll::Plugin
- Object
- CrazyDoll::Plugin
- SearchPlugin
- Defined in:
- lib/crazy_doll/plugins/search_plugin.rb
Instance Attribute Summary
Attributes inherited from CrazyDoll::Plugin
Instance Method Summary collapse
Methods inherited from CrazyDoll::Plugin
#c, config, #config, #current_channel, #current_nick, #custom_messages, #custom_messages_chan, #custom_messages_priv, #get, #initialize, #join, #parse_message, #post, #register_events, #register_keys, #reply, #reply_to, #reply_to_a_channel?, #say, #talked_with_me?
Constructor Details
This class inherits a constructor from CrazyDoll::Plugin
Instance Method Details
#google ⇒ Object
9 10 11 12 13 |
# File 'lib/crazy_doll/plugins/search_plugin.rb', line 9 def google return if c.number_of_results <= 0 reply RubyWebSearch::Google.search(:query => @params.query).results[0..(c.number_of_results-1)].map { |x| "#{CGI.unescapeHTML(x[:title])} - #{x[:url]}" }.join(" | ") end |