Advertisement
Guest User

Untitled

a guest
Jul 25th, 2012
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.65 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. # Input sanitation is done by wrapper.
  4.  
  5. whois.get "fred" do |hash|
  6.   do something with hash
  7. end
  8.  
  9. # Calling actions from the DB
  10. class Whois
  11.    
  12.     # This method is called when the plugin is first loaded
  13.     def initialize( status, config, output, irc, timer )
  14.         @status     = status
  15.         @config     = config
  16.         @output     = output
  17.         @irc        = irc
  18.         @timer      = timer
  19.         @whois      = Hash.new(0)
  20.     end
  21.    
  22.     # Generic function that can be called by any user
  23.     def get( nick, &block )
  24.         @irc.raw( "whois #{nick}" )
  25.         @callback = block
  26.     end
  27.     def whois( hash )
  28.         @irc.notice( "Xethron", "Whois Recieved" )
  29.                 @callback.call hash
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement