Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- raw_html = resp.body.grep(/(?:e|dn)lk[0-9]+/)
- raw_html.delete_at 0
- raw_html.inject do |memo, row|
- c_info = row.match(/(e|dn)lk([0-9])+/)
- # Same contact, or different?
- build_contacts << [] if memo != c_info[2]
- # Grab info
- case c_info[1]
- when "e" # Email
- build_contacts.last[1] = row.match(/#{email_match_text_beginning}(.*)#{email_match_text_end}/)[1]
- when "dn" # Name
- build_contacts.last[0] = row.match(/<a[^>]*>(.+)<\/a>/)[1]
- end
- # Set memo to contact id
- c_info[2]
- end
Add Comment
Please, Sign In to add comment