Created
August 25, 2010 09:45
-
-
Save rjp/549198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'UAClient' | |
class LaraBot < UAClient | |
def announce_user_page(x) | |
who = x['fromname'] | |
what = x['text'] | |
puts "#{who} has paged me, returning their call" | |
puts "[#{what}]" | |
self.page(who, "Thank you for paging bot - #{what}") | |
self.disconnect if what =~ /quit/ | |
end | |
# announce messages | |
def announce_message_add(x) | |
folder = x['foldername'] | |
subject = x['subject'] | |
to = x['toname'] | |
from = x['fromname'] | |
id = x['messageid'] | |
puts "#{folder}/#{id} ``#{subject}'' #{from} => #{to}" | |
$stdout.flush | |
end | |
end | |
larabot = LaraBot.new("ua2.org", 2020) | |
larabot.login('sadbot', 'ad09cd') | |
larabot.user_list() | |
larabot.start() | |
# bob is now thine uncle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment