Skip to content

Instantly share code, notes, and snippets.

@rjp
Created August 25, 2010 09:45
Show Gist options
  • Save rjp/549198 to your computer and use it in GitHub Desktop.
Save rjp/549198 to your computer and use it in GitHub Desktop.
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