Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "jabberjaw" #I need a new name, since I am decoupling this from XMPP...
- setup do
- add_transport :xmpp,
- :username => 'something',
- :password => '*****',
- :server => 'goteamfun.com'
- add_transport :email,
- :class => JabberJaw::Examples::POPJaw
- :username => 'arragh',
- :password => '********',
- :server => 'goteamfun.com'
- end
- commands do
- echo do
- message
- end
- md5 do |encode_string|
- send sender, MD5.hexdigest(encode_string)
- end
- subscribe :transports => [:email] do |list_names|
- list_names.each {|list| lists[list] << sender}
- "Subscribed to #{list_names.join(', ')}!"
- end
- end
- command /(.+) command in the middle (.+)/ do |beginning, ending|
- "This command does nothing."
- end.help = "A useless command."
- # manually invoking echo
- JabberJaw::Commands::Echo.new(:email,
- :from => 'chris@chrisrhoden.com', :message => "will send this to me in email")
- # one can also use
- # JabberJaw.invoke('echo', :email, :from ...
- # Note that this should be a responder primarily, there are far better systems for just sending.
Add Comment
Please, Sign In to add comment