lperichon-contacts 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/contacts/google.rb +4 -0
- data/lib/contacts/yahoo.rb +4 -0
- metadata +8 -3
data/lib/contacts/google.rb
CHANGED
@@ -57,6 +57,7 @@ module Contacts
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def parse_contacts(body)
|
60
|
+
begin
|
60
61
|
document = Nokogiri::XML(body)
|
61
62
|
document.search('/xmlns:feed/xmlns:entry').map do |entry|
|
62
63
|
emails = entry.search('./gd:email[@address]').map{|e| e['address'].to_s}
|
@@ -65,6 +66,9 @@ module Contacts
|
|
65
66
|
name = title.inner_text
|
66
67
|
Contact.new(name, emails)
|
67
68
|
end.compact
|
69
|
+
rescue
|
70
|
+
return nil
|
71
|
+
end
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
data/lib/contacts/yahoo.rb
CHANGED
@@ -55,6 +55,7 @@ module Contacts
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def parse_contacts(text)
|
58
|
+
begin
|
58
59
|
result = JSON.parse(text)
|
59
60
|
if result['contacts']
|
60
61
|
result['contacts']['contact'].map do |contact_object|
|
@@ -75,6 +76,9 @@ module Contacts
|
|
75
76
|
else
|
76
77
|
[]
|
77
78
|
end
|
79
|
+
rescue
|
80
|
+
return nil
|
81
|
+
end
|
78
82
|
end
|
79
83
|
end
|
80
84
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lperichon-contacts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
9
|
+
- 7
|
10
|
+
version: 1.0.7
|
10
11
|
platform: ruby
|
11
12
|
authors: []
|
12
13
|
|
@@ -68,23 +69,27 @@ rdoc_options: []
|
|
68
69
|
require_paths:
|
69
70
|
- lib
|
70
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
71
73
|
requirements:
|
72
74
|
- - ">="
|
73
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
74
77
|
segments:
|
75
78
|
- 0
|
76
79
|
version: "0"
|
77
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
78
82
|
requirements:
|
79
83
|
- - ">="
|
80
84
|
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
81
86
|
segments:
|
82
87
|
- 0
|
83
88
|
version: "0"
|
84
89
|
requirements: []
|
85
90
|
|
86
91
|
rubyforge_project:
|
87
|
-
rubygems_version: 1.3.
|
92
|
+
rubygems_version: 1.3.7
|
88
93
|
signing_key:
|
89
94
|
specification_version: 3
|
90
95
|
summary: Fetch users' contact lists without asking them to provide their passwords, as painlessly as possible.
|