liangzan-contacts 1.2.16 → 1.2.17
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/contacts.rb +1 -1
- data/lib/contacts/aol.rb +1 -0
- data/lib/contacts/base.rb +29 -9
- data/lib/contacts/gmail.rb +1 -0
- data/lib/contacts/gmx.rb +1 -0
- data/lib/contacts/hotmail.rb +1 -0
- data/lib/contacts/inbox_lt.rb +1 -0
- data/lib/contacts/mailru.rb +1 -0
- data/lib/contacts/onelt.rb +1 -0
- data/lib/contacts/seznam.rb +1 -0
- data/lib/contacts/{tmobile_de.rb → tonline_de.rb} +4 -3
- data/lib/contacts/web_de.rb +1 -0
- data/lib/contacts/yahoo.rb +1 -0
- metadata +12 -12
data/lib/contacts.rb
CHANGED
data/lib/contacts/aol.rb
CHANGED
@@ -2,6 +2,7 @@ class Contacts
|
|
2
2
|
require 'hpricot' if RUBY_VERSION < '1.9'
|
3
3
|
require 'csv'
|
4
4
|
class Aol < Base
|
5
|
+
DETECTED_DOMAINS = [ /aol.com/i ]
|
5
6
|
URL = "http://www.aol.com/"
|
6
7
|
LOGIN_URL = "https://my.screenname.aol.com/_cqr/login/login.psp"
|
7
8
|
LOGIN_REFERER_URL = "http://webmail.aol.com/"
|
data/lib/contacts/base.rb
CHANGED
@@ -11,6 +11,8 @@ class Contacts
|
|
11
11
|
TYPES = {}
|
12
12
|
|
13
13
|
class Base
|
14
|
+
DETECTED_DOMAINS = []
|
15
|
+
|
14
16
|
def initialize(login, password, options={})
|
15
17
|
@login = login
|
16
18
|
@password = password
|
@@ -212,18 +214,36 @@ class Contacts
|
|
212
214
|
end
|
213
215
|
end
|
214
216
|
|
215
|
-
def self.
|
217
|
+
def self.get_email_domain(email)
|
218
|
+
name, domain = email.split('@')
|
219
|
+
domain
|
220
|
+
end
|
221
|
+
|
222
|
+
def self.guess_importer(email, options={})
|
216
223
|
if keys = options[:types]
|
217
224
|
types = TYPES.select{|k, v| keys.include?(k)}
|
218
|
-
end
|
225
|
+
end
|
219
226
|
types ||= TYPES
|
220
227
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
+
email_domain = get_email_domain(email)
|
229
|
+
|
230
|
+
types.values.find do |klass|
|
231
|
+
klass::DETECTED_DOMAINS.any? { |m| email_domain.match(m) }
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
def self.guess(email, password, options={})
|
236
|
+
klass = guess_importer(email, options)
|
237
|
+
|
238
|
+
return if klass.nil?
|
239
|
+
|
240
|
+
a = []
|
241
|
+
|
242
|
+
begin
|
243
|
+
a = klass.new(email, password, options).contacts
|
244
|
+
rescue AuthenticationError
|
245
|
+
end
|
246
|
+
|
247
|
+
return a
|
228
248
|
end
|
229
249
|
end
|
data/lib/contacts/gmail.rb
CHANGED
data/lib/contacts/gmx.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Contacts
|
2
2
|
class Gmx < Base
|
3
|
+
DETECTED_DOMAINS = [ /gmx.de/i, /gmx.at/i, /gmx.ch/i, /gmx.net/i ]
|
3
4
|
LOGIN_URL = "https://service.gmx.net/de/cgi/login"
|
4
5
|
ADDRESS_BOOK_URL = "https://service.gmx.net/de/cgi/g.fcgi/addressbook/cab?cc=subnavi_adressbuch&sid="
|
5
6
|
EXPORT_URL = "https://adressbuch.gmx.net/exportcontacts"
|
data/lib/contacts/hotmail.rb
CHANGED
@@ -4,6 +4,7 @@ require 'nokogiri'
|
|
4
4
|
|
5
5
|
class Contacts
|
6
6
|
class Hotmail < Base
|
7
|
+
DETECTED_DOMAINS = [ /hotmail/i, /live/i, /msn/i, /chaishop/i ]
|
7
8
|
URL = "https://login.live.com/login.srf?id=2"
|
8
9
|
CONTACT_LIST_URL = "https://mail.live.com/mail/GetContacts.aspx"
|
9
10
|
PROTOCOL_ERROR = "Hotmail has changed its protocols, please upgrade this library first. If that does not work, report this error at http://rubyforge.org/forum/?group_id=2693"
|
data/lib/contacts/inbox_lt.rb
CHANGED
data/lib/contacts/mailru.rb
CHANGED
data/lib/contacts/onelt.rb
CHANGED
data/lib/contacts/seznam.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
class Contacts
|
2
2
|
class Seznam < Base
|
3
|
+
DETECTED_DOMAINS = [ /seznam\.cz/i, /email\.cz/i, /post\.cz/i, /spoluzaci\.cz/i, /stream\.cz/i, /firmy\.cz/i, ]
|
3
4
|
LOGIN_URL = "https://login.szn.cz/loginProcess"
|
4
5
|
ADDRESS_BOOK_URL = "http://email.seznam.cz/abookCsvExport?sessionId=&charset=utf-8&eof=windows&export=nameLast&export=nameFirst&export=nick&export=email"
|
5
6
|
|
@@ -1,8 +1,9 @@
|
|
1
1
|
class Contacts
|
2
|
-
class
|
2
|
+
class TonlineDe < Base
|
3
|
+
DETECTED_DOMAINS = [ /t-mobile\.de/i, /t-online\.de/i ]
|
3
4
|
URL = "https://email.t-online.de/V4-0-4-0/srv-bin/aaa?method=deliverLoginBox"
|
4
5
|
ADDRESS_BOOK_URL = "https://email.t-online.de/V4-0-4-0/srv-bin/addressbook?method=exportAdressbook&p%5Bformat%5D=CSV&p%5Bliid%5D="
|
5
|
-
PROTOCOL_ERROR = "t-
|
6
|
+
PROTOCOL_ERROR = "t-online.de has changed its protocols"
|
6
7
|
|
7
8
|
attr_accessor :cookies, :tid
|
8
9
|
|
@@ -74,5 +75,5 @@ class Contacts
|
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
77
|
-
TYPES[:
|
78
|
+
TYPES[:tonline_de] = TonlineDe
|
78
79
|
end
|
data/lib/contacts/web_de.rb
CHANGED
data/lib/contacts/yahoo.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liangzan-contacts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,11 +13,11 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2012-03-
|
16
|
+
date: 2012-03-26 00:00:00.000000000Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|
20
|
-
requirement: &
|
20
|
+
requirement: &10538000 !ruby/object:Gem::Requirement
|
21
21
|
none: false
|
22
22
|
requirements:
|
23
23
|
- - ~>
|
@@ -25,10 +25,10 @@ dependencies:
|
|
25
25
|
version: 1.6.5
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
|
-
version_requirements: *
|
28
|
+
version_requirements: *10538000
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: gdata_19
|
31
|
-
requirement: &
|
31
|
+
requirement: &10536780 !ruby/object:Gem::Requirement
|
32
32
|
none: false
|
33
33
|
requirements:
|
34
34
|
- - ~>
|
@@ -36,10 +36,10 @@ dependencies:
|
|
36
36
|
version: 1.1.3
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
|
-
version_requirements: *
|
39
|
+
version_requirements: *10536780
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: nokogiri
|
42
|
-
requirement: &
|
42
|
+
requirement: &10535740 !ruby/object:Gem::Requirement
|
43
43
|
none: false
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
@@ -47,22 +47,22 @@ dependencies:
|
|
47
47
|
version: 1.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
|
-
version_requirements: *
|
50
|
+
version_requirements: *10535740
|
51
51
|
description: A universal interface to grab contact list information from Yahoo, AOL,
|
52
|
-
Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.
|
52
|
+
Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.lt, seznam.cz, t-online.de. Now supporting
|
53
53
|
Ruby 1.9.
|
54
54
|
email: zan@liangzan.net
|
55
55
|
executables: []
|
56
56
|
extensions: []
|
57
57
|
extra_rdoc_files: []
|
58
58
|
files:
|
59
|
+
- lib/contacts/tonline_de.rb
|
59
60
|
- lib/contacts/inbox_lt.rb
|
60
61
|
- lib/contacts/base.rb
|
61
62
|
- lib/contacts/web_de.rb
|
62
63
|
- lib/contacts/gmail.rb
|
63
64
|
- lib/contacts/plaxo.rb
|
64
65
|
- lib/contacts/onelt.rb
|
65
|
-
- lib/contacts/tmobile_de.rb
|
66
66
|
- lib/contacts/yahoo.rb
|
67
67
|
- lib/contacts/seznam.rb
|
68
68
|
- lib/contacts/hotmail.rb
|
@@ -98,6 +98,6 @@ rubyforge_project:
|
|
98
98
|
rubygems_version: 1.8.10
|
99
99
|
signing_key:
|
100
100
|
specification_version: 3
|
101
|
-
summary: grab contacts from Yahoo, AOL, Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.
|
102
|
-
seznam.cz,
|
101
|
+
summary: grab contacts from Yahoo, AOL, Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.lt,
|
102
|
+
seznam.cz, t-online.de
|
103
103
|
test_files: []
|