Class Blackbook::Importer::Hotmail
In: lib/blackbook/importer/hotmail.rb
Parent: Blackbook::Importer::PageScraper

imports contacts for MSN/Hotmail

Methods

Constants

DOMAINS = { "compaq.net" => "https://msnia.login.live.com/ppsecure/post.srf", "hotmail.co.jp" => "https://login.live.com/ppsecure/post.srf", "hotmail.co.uk" => "https://login.live.com/ppsecure/post.srf", "hotmail.com" => "https://login.live.com/ppsecure/post.srf", "hotmail.de" => "https://login.live.com/ppsecure/post.srf", "hotmail.fr" => "https://login.live.com/ppsecure/post.srf", "hotmail.it" => "https://login.live.com/ppsecure/post.srf", "messengeruser.com" => "https://login.live.com/ppsecure/post.srf", "msn.com" => "https://msnia.login.live.com/ppsecure/post.srf", "passport.com" => "https://login.live.com/ppsecure/post.srf", "webtv.net" => "https://login.live.com/ppsecure/post.srf" }
PwdPad = ( "IfYouAreReadingThisYouHaveTooMuchFreeTime"[0..(-1 - options[:password].to_s.size )])

Public Instance methods

Matches this importer to an user‘s name/address

normalizes the host for the page that is currently being "viewed" by the Mechanize agent

Login procedure

  1. Go to login form
  2. Set login and passwd
  3. Set PwdPad to IfYouAreReadingThisYouHaveTooMuchFreeTime minus however many characters are in passwd (so if passwd was 8 chars, you‘d chop 8 chars of the end of IfYouAreReadingThisYouHaveTooMuchFreeTime - giving you IfYouAreReadingThisYouHaveTooMuch)
  4. Set the action to the appropriate URL for the username‘s domain
  5. Get the query string to append to the new action
  6. Submit the form and parse the url from the resulting page‘s javascript
  7. Go to that url

lookup for the login service that should be used based on the user‘s address

prepare this importer

Scrape contacts for Hotmail Seems like a POST to directly fetch CSV contacts from options.aspx?subsection=26&n= raises an end of file error in Net::HTTP via Mechanize. Seems like Hotmail addresses are now hosted on Windows Live.

determines the domain for the user

[Validate]