fullcontacter 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/.document +5 -0
  2. data/.gitignore +53 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.md +20 -0
  6. data/README.md +36 -0
  7. data/Rakefile +25 -0
  8. data/VERSION +1 -0
  9. data/bugs.txt +2 -0
  10. data/fullcontact.gemspec +34 -0
  11. data/lib/faraday/request/gateway.rb +18 -0
  12. data/lib/faraday/response/fullcontact_errors.rb +33 -0
  13. data/lib/faraday/response/raise_http_4xx.rb +45 -0
  14. data/lib/faraday/response/raise_http_5xx.rb +24 -0
  15. data/lib/fullcontact.rb +27 -0
  16. data/lib/fullcontact/api.rb +21 -0
  17. data/lib/fullcontact/client.rb +32 -0
  18. data/lib/fullcontact/client/batch_process.rb +35 -0
  19. data/lib/fullcontact/client/contact.rb +119 -0
  20. data/lib/fullcontact/client/contact_list.rb +84 -0
  21. data/lib/fullcontact/client/icon.rb +35 -0
  22. data/lib/fullcontact/client/name.rb +167 -0
  23. data/lib/fullcontact/client/person.rb +94 -0
  24. data/lib/fullcontact/client/provisioning.rb +28 -0
  25. data/lib/fullcontact/client/snapshot.rb +31 -0
  26. data/lib/fullcontact/client/subscription.rb +45 -0
  27. data/lib/fullcontact/client/user.rb +28 -0
  28. data/lib/fullcontact/configuration.rb +95 -0
  29. data/lib/fullcontact/connection.rb +36 -0
  30. data/lib/fullcontact/error.rb +35 -0
  31. data/lib/fullcontact/request.rb +43 -0
  32. data/lib/fullcontact/version.rb +3 -0
  33. data/spec/faraday/response_spec.rb +56 -0
  34. data/spec/fixtures/clear_contact_list.json +3 -0
  35. data/spec/fixtures/contact_history.json +16 -0
  36. data/spec/fixtures/create_contact_list.json +4 -0
  37. data/spec/fixtures/create_snapshot.json +7 -0
  38. data/spec/fixtures/create_subscription.json +4 -0
  39. data/spec/fixtures/deduce_by_email.json +13 -0
  40. data/spec/fixtures/deduce_by_username.json +13 -0
  41. data/spec/fixtures/delete_contact.json +4 -0
  42. data/spec/fixtures/delete_contact_list.json +3 -0
  43. data/spec/fixtures/delete_subscription.json +3 -0
  44. data/spec/fixtures/get_contact.json +20 -0
  45. data/spec/fixtures/get_contact_lists.json +11 -0
  46. data/spec/fixtures/get_contacts_in_a_list.json +41 -0
  47. data/spec/fixtures/get_enriched_contact.json +261 -0
  48. data/spec/fixtures/get_updates.json +252 -0
  49. data/spec/fixtures/has_enriched_updates.json +4 -0
  50. data/spec/fixtures/list_snapshots.json +7 -0
  51. data/spec/fixtures/list_subscriptions.json +10 -0
  52. data/spec/fixtures/normalize.json +27 -0
  53. data/spec/fixtures/parse.json +10 -0
  54. data/spec/fixtures/person.json +47 -0
  55. data/spec/fixtures/queue_contact_list_for_enrichment.json +3 -0
  56. data/spec/fixtures/save_enriched_contact.json +261 -0
  57. data/spec/fixtures/similarity.json +45 -0
  58. data/spec/fixtures/stats_by_family_name.json +12 -0
  59. data/spec/fixtures/stats_by_given_and_family_name.json +62 -0
  60. data/spec/fixtures/stats_by_given_name.json +57 -0
  61. data/spec/fixtures/stats_by_name.json +64 -0
  62. data/spec/fixtures/update_contact.json +9 -0
  63. data/spec/fullcontact/api_spec.rb +68 -0
  64. data/spec/fullcontact/client/contact_list_spec.rb +89 -0
  65. data/spec/fullcontact/client/contact_spec.rb +108 -0
  66. data/spec/fullcontact/client/icon_spec.rb +24 -0
  67. data/spec/fullcontact/client/name_spec.rb +121 -0
  68. data/spec/fullcontact/client/person_spec.rb +77 -0
  69. data/spec/fullcontact/client/snapshot_spec.rb +35 -0
  70. data/spec/fullcontact/client/subscription_spec.rb +47 -0
  71. data/spec/fullcontact/client_spec.rb +10 -0
  72. data/spec/fullcontact_spec.rb +114 -0
  73. data/spec/helper.rb +39 -0
  74. metadata +384 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "hasUpdates": true,
3
+ "status": 200
4
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "snapshots": [
3
+ "Test",
4
+ "Test1"
5
+ ],
6
+ "status": 200
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "subscriptions": [
3
+ {
4
+ "id": "bfe3a7f46a37f05622136bd8cb57b1dd1fd20312",
5
+ "event": "ENRICHED",
6
+ "callbackUrl": "http://www.example.com"
7
+ }
8
+ ],
9
+ "status": 200
10
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "status": 200,
3
+ "likelihood": 0.774,
4
+ "nameDetails": {
5
+ "givenName": "John",
6
+ "familyName": "Smith",
7
+ "middleNames":
8
+ [
9
+ "Michael"
10
+ ],
11
+ "prefixes":
12
+ [
13
+ "Mr."
14
+ ],
15
+ "suffixes":
16
+ [
17
+ "Jr.",
18
+ "MBA"
19
+ ],
20
+ "nicknames":
21
+ [
22
+ "Johnny"
23
+ ],
24
+ "fullName": "John Michael Smith"
25
+ },
26
+ "region": "USA"
27
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "status": 200,
3
+ "ambiguousName": "John Smith",
4
+ "result": {
5
+ "givenName": "John",
6
+ "familyName": "Smith",
7
+ "likelihood": 1
8
+ },
9
+ "region": "USA"
10
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "status": 200,
3
+ "photos":
4
+ [
5
+ {
6
+ "url": "http://a0.twimg.com/profile_images/1084241539/steps_normal.jpg",
7
+ "type": "twitter"
8
+ },
9
+ {
10
+ "isPrimary": false,
11
+ "type": "gravatar",
12
+ "url": "https://secure.gravatar.com/avatar/b2f65d319b253da9cf92635d8eac808b"
13
+ },
14
+ {
15
+ "message": "More Data Available - 3rd party credentials required - contact api@fullcontact.cc for more information."
16
+ }
17
+ ],
18
+ "contactInfo": {
19
+ "familyName": "West",
20
+ "givenName": "Brandon",
21
+ "fullName": "Brandon West"
22
+ },
23
+ "demographics": {
24
+ "age": {
25
+ "message": "More Data Available - 3rd party credentials required - contact api@fullcontact.cc for more information."
26
+ },
27
+ "locationGeneral": "Littleton, Colorado",
28
+ "gender": {
29
+ "message": "More Data Available - 3rd party credentials required - contact api@fullcontact.cc for more information."
30
+ }
31
+ },
32
+ "socialProfiles":
33
+ [
34
+ {
35
+ "url": "http://twitter.com/brandonmwest",
36
+ "id": "16517063",
37
+ "type": "twitter",
38
+ "username": "brandonmwest"
39
+ },
40
+ {
41
+ "message": "More Data Available - 3rd party credentials required - contact api@fullcontact.cc for more information."
42
+ },
43
+ {
44
+ "message": "More Data Available - 3rd party credentials required - contact api@fullcontact.cc for more information."
45
+ }
46
+ ]
47
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "status": 200
3
+ }
@@ -0,0 +1,261 @@
1
+ {
2
+ "data":
3
+ [
4
+ {
5
+ "name": {
6
+ "familyName": "Lorang",
7
+ "givenName": "Bart"
8
+ },
9
+ "phoneNumbers":
10
+ [
11
+ {
12
+ "value": "+1-303-717-0414"
13
+ }
14
+ ],
15
+ "emails":
16
+ [
17
+ {
18
+ "value": "bart@fullcontact.com",
19
+ "type": "INTERNET"
20
+ }
21
+ ],
22
+ "photos":
23
+ [
24
+ {
25
+ "value": "https://img-s.foursquare.com/userpix_thumbs/V4ZAH05UTC5TWEYM.jpg",
26
+ "type": "foursquare"
27
+ },
28
+ {
29
+ "value": "https://playfoursquare.s3.amazonaws.com/userpix_thumbs/V4ZAH05UTC5TWEYM.jpg",
30
+ "type": "foursquare"
31
+ },
32
+ {
33
+ "value": "http://a2.ec-images.myspacecdn.com/profile01/114/97c130815ed44e47a19080f970706dbe/s.jpg",
34
+ "type": "myspace"
35
+ },
36
+ {
37
+ "value": "http://graph.facebook.com/651620441/picture?type=large",
38
+ "type": "facebook"
39
+ },
40
+ {
41
+ "value": "http://social.sxsw.com//system/badge_photos/46809/thumb/photo.jpg",
42
+ "type": "sxsw"
43
+ },
44
+ {
45
+ "value": "https://tungle.me/public/bartlorang/Image",
46
+ "type": "tungleme"
47
+ },
48
+ {
49
+ "value": "https://is1.4sqi.net/userpix_thumbs/V4ZAH05UTC5TWEYM.jpg",
50
+ "type": "other"
51
+ },
52
+ {
53
+ "value": "http://1.gravatar.com/avatar/956b7dca7c77a12c43ebe9ae09dfaba8",
54
+ "type": "gravatar"
55
+ },
56
+ {
57
+ "value": "http://qph.cf.quoracdn.net/main-thumb-235179-200-jKTxWZQMbAl9MrGaLTDAs19WUiZoCuPW.jpeg",
58
+ "type": "quora"
59
+ },
60
+ {
61
+ "value": "http://2.gravatar.com/avatar/e1e94ffac5967195d81ac3e68ba8aa0c",
62
+ "type": "gravatar"
63
+ },
64
+ {
65
+ "value": "http://plancast.com/uploads/pics/44636_pic_1314224723.jpg",
66
+ "type": "plancast"
67
+ },
68
+ {
69
+ "value": "http://a0.twimg.com/profile_images/642635573/ForsetiAvatar_normal.png",
70
+ "type": "twitter"
71
+ },
72
+ {
73
+ "value": "http://media.linkedin.com/mpr/pub/image-8kD9yK95845PPSkQ3U3ryL0B2bTfOSKQ2EBfy9Si3h5FEh6_/bart-lorang.jpg",
74
+ "type": "linkedin"
75
+ },
76
+ {
77
+ "value": "http://a0.twimg.com/profile_images/1364842224/Bart_Profile_1_normal.jpg",
78
+ "type": "twitter"
79
+ },
80
+ {
81
+ "value": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/41508_651620441_4210927_q.jpg",
82
+ "type": "facebook"
83
+ },
84
+ {
85
+ "value": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/41508_651620441_4210927_n.jpg",
86
+ "type": "facebook"
87
+ },
88
+ {
89
+ "value": "http://www.google.com/s2/photos/public/AIbEiAIAAABECJno7ZvvpqKayAEiC3ZjYXJkX3Bob3RvKigzMWI2OTJkYmVkZjE0NDMyMWZiZjY0ZmRjNGFkMWMyYjFiZTJiNzI5MAGr1Y9MU6EKYlsSx1dHmsrn4AYZ8g",
90
+ "type": "other"
91
+ },
92
+ {
93
+ "value": "http://plancast.com/uploads/pics/44636_pic_square_1314224723.jpg",
94
+ "type": "plancast"
95
+ },
96
+ {
97
+ "value": "http://i4.ytimg.com/vi/oVB_WdQXzls/default.jpg",
98
+ "type": "youtube"
99
+ },
100
+ {
101
+ "value": "http://d2o7bfz2il9cb7.cloudfront.net/main-thumb-235179-100-jKTxWZQMbAl9MrGaLTDAs19WUiZoCuPW.jpeg",
102
+ "type": "quora"
103
+ },
104
+ {
105
+ "value": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/161274_651620441_7937905_n.jpg",
106
+ "type": "facebook"
107
+ },
108
+ {
109
+ "value": "http://www.google.com/s2/photos/public/AIbEiAIAAABECJno7ZvvpqKayAEiC3ZjYXJkX3Bob3RvKihmYTAyNmViNGY4MDNjYWJiMDg2Y2I5ZjBhZDhlMWM5YzU2NTc1ZjVlMAG03P6jBkfZy8aWki7yrEp6B4HUDQ",
110
+ "type": "other"
111
+ },
112
+ {
113
+ "value": "http://a2.twimg.com/profile_images/642635573/ForsetiAvatar_normal.png",
114
+ "type": "twitter"
115
+ }
116
+ ],
117
+ "organizations":
118
+ [
119
+ {
120
+ "name": "FullContact",
121
+ "title": "CEO & Co-Founder",
122
+ "isPrimary": false
123
+ },
124
+ {
125
+ "name": "Techstars",
126
+ "isPrimary": false
127
+ },
128
+ {
129
+ "name": "Rainmaker Technologies",
130
+ "title": "Co-Founder & CEO",
131
+ "isPrimary": false
132
+ },
133
+ {
134
+ "name": "FullContact",
135
+ "title": "Co-Founder & CEO",
136
+ "isPrimary": false
137
+ },
138
+ {
139
+ "name": "FullContact",
140
+ "title": "CEO",
141
+ "isPrimary": false
142
+ },
143
+ {
144
+ "name": "FullContact",
145
+ "title": "Chief Executive Officer and Co-Founder",
146
+ "isPrimary": false
147
+ }
148
+ ],
149
+ "gender": "Male",
150
+ "urls":
151
+ [
152
+ {
153
+ "value": "http://whosent.it",
154
+ "type": "other"
155
+ },
156
+ {
157
+ "value": "http://profiles.google.com/lorangb",
158
+ "type": "googleprofile"
159
+ },
160
+ {
161
+ "value": "http://gravatar.com/blorang",
162
+ "type": "gravatar"
163
+ },
164
+ {
165
+ "value": "http://www.klout.com/lorangb",
166
+ "type": "klout"
167
+ },
168
+ {
169
+ "value": "http://blog.fullcontact.com",
170
+ "type": "other"
171
+ },
172
+ {
173
+ "value": "http://plancast.com/lorangb",
174
+ "type": "plancast"
175
+ },
176
+ {
177
+ "value": "http://tungle.me/bartlorang",
178
+ "type": "tungleme"
179
+ },
180
+ {
181
+ "value": "http://www.myspace.com/137200880",
182
+ "type": "myspace"
183
+ },
184
+ {
185
+ "value": "http://social.sxsw.com/users/46809",
186
+ "type": "sxsw"
187
+ },
188
+ {
189
+ "value": "https://plus.google.com/114426306375480734745",
190
+ "type": "googleplus"
191
+ },
192
+ {
193
+ "value": "http://facebook.com/bart.lorang",
194
+ "type": "facebook"
195
+ },
196
+ {
197
+ "value": "http://fullcontact.com",
198
+ "type": "other"
199
+ },
200
+ {
201
+ "value": "http://picasaweb.google.com/lorangb",
202
+ "type": "picasa"
203
+ },
204
+ {
205
+ "value": "http://about.me/lorangb",
206
+ "type": "aboutme"
207
+ },
208
+ {
209
+ "value": "http://rainmaker.cc/",
210
+ "type": "other"
211
+ },
212
+ {
213
+ "value": "http://www.linkedin.com/in/bartlorang",
214
+ "type": "linkedin"
215
+ },
216
+ {
217
+ "value": "http://foursquare.com/lorangb",
218
+ "type": "foursquare"
219
+ },
220
+ {
221
+ "value": "http://www.quora.com/bart-lorang",
222
+ "type": "quora"
223
+ },
224
+ {
225
+ "value": "http://www.flickr.com/people/39267654@N00/",
226
+ "type": "flickr"
227
+ },
228
+ {
229
+ "value": "http://youtube.com/user/lorangb",
230
+ "type": "youtube"
231
+ },
232
+ {
233
+ "value": "http://www.twitter.com/lorangb",
234
+ "type": "twitter"
235
+ }
236
+ ],
237
+ "addresses":
238
+ [
239
+ {
240
+ "locality": "Boulder",
241
+ "region": " Colorado",
242
+ "type": "Home"
243
+ }
244
+ ],
245
+ "ims":
246
+ [
247
+ {
248
+ "value": "lorangb@gmail.com",
249
+ "type": "gtalk"
250
+ },
251
+ {
252
+ "value": "bart.lorang",
253
+ "type": "skype"
254
+ }
255
+ ],
256
+ "id": "06qhFJxUUx",
257
+ "age": "32"
258
+ }
259
+ ],
260
+ "status": 200
261
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "result": {
3
+ "SimMetrics": {
4
+ "jaroWinkler": {
5
+ "similarity": 0.8,
6
+ "timeEstimated": 0.0017368001,
7
+ "timeActual": 0
8
+ },
9
+ "levenshtein": {
10
+ "similarity": 0.39999998,
11
+ "timeEstimated": 0.0072,
12
+ "timeActual": 0
13
+ }
14
+ },
15
+ "SecondString": {
16
+ "jaroWinkler": {
17
+ "similarity": 0.7999999999999999,
18
+ "timeTaken": "3 ms"
19
+ },
20
+ "levenshtein": {
21
+ "similarity": 0.4,
22
+ "timeTaken": "3 ms",
23
+ "distance": 6
24
+ },
25
+ "level2jaroWinkler": {
26
+ "similarity": 0.888888888888889,
27
+ "timeTaken": "3 ms"
28
+ },
29
+ "level2levenshtein": {
30
+ "similarity": 0.5,
31
+ "timeTaken": "1 ms",
32
+ "distance": 5
33
+ }
34
+ },
35
+ "FullContact": {
36
+ "BigramAnalysis": {
37
+ "dice": {
38
+ "similarity": 0.5,
39
+ "timeTaken": "15 ms"
40
+ }
41
+ }
42
+ }
43
+ },
44
+ "status": 200
45
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "status": 200,
3
+ "name": {
4
+ "value": "Smith",
5
+ "family": {
6
+ "count": 2376206,
7
+ "rank": 1,
8
+ "frequencyRatio": "0.009814123"
9
+ }
10
+ },
11
+ "region": "USA"
12
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "status": 200,
3
+ "name": {
4
+ "value": "John Smith",
5
+ "given": {
6
+ "count": 3499150,
7
+ "rank": 3,
8
+ "male": {
9
+ "count": 3484136,
10
+ "likelihood": 0.996,
11
+ "rank": 3,
12
+ "frequencyRatio": "0.026305137",
13
+ "age": {
14
+ "densityCurve": {
15
+ "mode": {
16
+ "count": 77174,
17
+ "modeAge":
18
+ [
19
+ 47
20
+ ]
21
+ },
22
+ "meanAge": 51.2,
23
+ "quartiles": {
24
+ "q1": 35.3,
25
+ "q2": 50.5,
26
+ "q3": 62.9
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "female": {
32
+ "count": 15015,
33
+ "likelihood": 0.004,
34
+ "rank": 928,
35
+ "frequencyRatio": "0.00011386",
36
+ "age": {
37
+ "densityCurve": {
38
+ "mode": {
39
+ "count": 297,
40
+ "modeAge":
41
+ [
42
+ 43
43
+ ]
44
+ },
45
+ "meanAge": 48.5,
46
+ "quartiles": {
47
+ "q1": 34.8,
48
+ "q2": 49.4,
49
+ "q3": 69.4
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "family": {
56
+ "count": 2376206,
57
+ "rank": 1,
58
+ "frequencyRatio": "0.009814123"
59
+ }
60
+ },
61
+ "region": "USA"
62
+ }