aeden-contacts 0.2.16 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/contacts/google.rb +8 -8
- data/lib/contacts/windows_live.rb +10 -2
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/contacts/google.rb
CHANGED
@@ -249,7 +249,7 @@ module Contacts
|
|
249
249
|
content_node = entry / 'atom:content'
|
250
250
|
|
251
251
|
service_id = id_node ? id_node.inner_text : nil
|
252
|
-
name = title_node ? title_node.
|
252
|
+
name = title_node ? title_node.inner_html : nil
|
253
253
|
|
254
254
|
contact = Contact.new(nil, name)
|
255
255
|
contact.service_id = service_id
|
@@ -268,13 +268,13 @@ module Contacts
|
|
268
268
|
end
|
269
269
|
phone_nodes.each do |n|
|
270
270
|
contact.phones << {
|
271
|
-
'value' => n.
|
271
|
+
'value' => n.inner_html,
|
272
272
|
'type' => (type_map[n['rel']] || 'other').to_s
|
273
273
|
}
|
274
274
|
end
|
275
275
|
address_nodes.each do |n|
|
276
276
|
contact.addresses << {
|
277
|
-
'formatted' => n.
|
277
|
+
'formatted' => n.inner_html,
|
278
278
|
'type' => (type_map[n['rel']] || 'other').to_s
|
279
279
|
}
|
280
280
|
end
|
@@ -287,14 +287,14 @@ module Contacts
|
|
287
287
|
|
288
288
|
contact.organizations << {
|
289
289
|
'type' => 'job',
|
290
|
-
'name' => org_name ? org_name.
|
291
|
-
'title' => org_title ? org_title.
|
292
|
-
'department' => org_department ? org_department.
|
293
|
-
'description' => org_description ? org_description.
|
290
|
+
'name' => org_name ? org_name.inner_html : '',
|
291
|
+
'title' => org_title ? org_title.inner_html : '',
|
292
|
+
'department' => org_department ? org_department.inner_html : '',
|
293
|
+
'description' => org_description ? org_description.inner_html : ''
|
294
294
|
}
|
295
295
|
end
|
296
296
|
end
|
297
|
-
contact.note = content_node ? content_node.
|
297
|
+
contact.note = content_node ? content_node.inner_html : ''
|
298
298
|
|
299
299
|
contacts_found << contact
|
300
300
|
end
|
@@ -50,7 +50,7 @@ module Contacts
|
|
50
50
|
#
|
51
51
|
class WindowsLive
|
52
52
|
CONFIG_FILE = File.dirname(__FILE__) + '/../config/contacts.yml'
|
53
|
-
|
53
|
+
attr_accessor :wll
|
54
54
|
# Initialize a new WindowsLive object.
|
55
55
|
#
|
56
56
|
# ==== Paramaters
|
@@ -90,6 +90,10 @@ module Contacts
|
|
90
90
|
@consent_token = @wll.processConsent(consent)
|
91
91
|
end
|
92
92
|
|
93
|
+
def process_consent_token(consent_token)
|
94
|
+
@wll.processConsentToken consent_token
|
95
|
+
end
|
96
|
+
|
93
97
|
# This method return the user's contacts inside an Array in the following
|
94
98
|
# format:
|
95
99
|
#
|
@@ -104,7 +108,11 @@ module Contacts
|
|
104
108
|
# the redirection POST from Windows Live
|
105
109
|
#
|
106
110
|
def contacts(consent)
|
107
|
-
|
111
|
+
if consent.is_a? WindowsLiveLogin::ConsentToken
|
112
|
+
@consent_token = consent
|
113
|
+
else
|
114
|
+
process_consent(consent)
|
115
|
+
end
|
108
116
|
contacts_xml = access_live_contacts_api()
|
109
117
|
contacts_list = WindowsLive.parse_xml(contacts_xml)
|
110
118
|
end
|