Class: MOG::Contacts::Plaxo

Inherits:
Base
  • Object
show all
Defined in:
lib/contacts/plaxo.rb

Constant Summary collapse

URL =
"http://www.plaxo.com/"
LOGIN_URL =
"https://www.plaxo.com/signin"
ADDRESS_BOOK_URL =
"http://www.plaxo.com/po3/?module=ab&operation=viewFull&mode=normal"
CONTACT_LIST_URL =
"http://www.plaxo.com/axis/soap/contact?_action=getContacts&_format=xml"
PROTOCOL_ERROR =
"Plaxo has changed its protocols, please upgrade this library first. If that does not work, dive into the code and submit a patch at http://github.com/cardmagic/contacts"

Instance Method Summary collapse

Instance Method Details

#contactsObject

real_connect



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/contacts/plaxo.rb', line 16

def contacts
  getdata = "&authInfo.authByEmail.email=%s" % CGI.escape()
  getdata += "&authInfo.authByEmail.password=%s" % CGI.escape(password)
  data, resp, cookies, forward = get(CONTACT_LIST_URL + getdata)

  if resp.code_type != Net::HTTPOK
    raise ConnectionError, PROTOCOL_ERROR
  end

  parse data
end

#real_connectObject



12
13
14
# File 'lib/contacts/plaxo.rb', line 12

def real_connect

end