Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing aol to strip out @aol.com from username. thanks cpjolicoeur

  • Loading branch information...
commit 621868e92bf98bf9d5270cfe0238beb89e3130f1 1 parent 7c61261
Lucas Carlson authored
Showing with 5 additions and 2 deletions.
  1. +4 −1 lib/contacts/aol.rb
  2. +1 −1  lib/contacts/yahoo.rb
View
5 lib/contacts/aol.rb
@@ -13,7 +13,10 @@ class Aol < Base
PROTOCOL_ERROR = "AOL 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"
def real_connect
-
+ if login.strip =~ /^(.+)@aol\.com$/ # strip off the @aol.com for AOL logins
+ login = $1
+ end
+
postdata = {
"loginId" => login,
"password" => password,
View
2  lib/contacts/yahoo.rb
@@ -92,7 +92,7 @@ def parse(data, options={})
@contacts ||= []
@contacts += Contacts.parse_json(data)["response"]["ResultSet"]["Contacts"].to_a.select{|contact|!contact["email"].to_s.empty?}.map do |contact|
name = contact["contactName"].split(",")
- [[name.pop, name.join(",")].join(" "), contact["email"]]
+ [[name.pop, name.join(",")].join(" ").strip, contact["email"]]
end if data =~ /^\{"response":/
@contacts
end
Please sign in to comment.
Something went wrong with that request. Please try again.