require 'win32ole' require 'digest/sha1' require 'cgi' out = STDOUT messenger = WIN32OLE.new('Messenger.UIAutomation.1') contacts = messenger.MyContacts out.puts < #{CGI.escapeHTML(messenger.MyFriendlyName)} #{Digest::SHA1.hexdigest("mailto:" + messenger.MySigninName)} #{CGI.escapeHTML(messenger.MySigninName).sub(/@/,'@')} END contacts.each{|c| out.puts < #{CGI.escapeHTML(c.FriendlyName)} #{Digest::SHA1.hexdigest("mailto:" + c.SigninName)} #{CGI.escapeHTML(c.SigninName).sub(/@/,'@')} END } out.puts < END