liangzan-contacts 1.2.15 → 1.2.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/contacts.rb +1 -0
- data/lib/contacts/seznam.rb +1 -2
- data/lib/contacts/tmobile_de.rb +78 -0
- metadata +12 -11
data/lib/contacts.rb
CHANGED
data/lib/contacts/seznam.rb
CHANGED
@@ -42,10 +42,9 @@ class Contacts
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def contacts
|
45
|
-
url = ADDRESS_BOOK_URL
|
46
45
|
@contacts = []
|
47
46
|
|
48
|
-
data, resp, self.cookies, forward = get(
|
47
|
+
data, resp, self.cookies, forward = get(ADDRESS_BOOK_URL, self.cookies)
|
49
48
|
|
50
49
|
CSV.parse(data, { :col_sep => ';' }) do |row|
|
51
50
|
last_name, first_name, unknown, email = row
|
@@ -0,0 +1,78 @@
|
|
1
|
+
class Contacts
|
2
|
+
class TmobileDe < Base
|
3
|
+
URL = "https://email.t-online.de/V4-0-4-0/srv-bin/aaa?method=deliverLoginBox"
|
4
|
+
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-mobile.de has changed its protocols"
|
6
|
+
|
7
|
+
attr_accessor :cookies, :tid
|
8
|
+
|
9
|
+
def real_connect
|
10
|
+
data, resp, self.cookies, forward = get(URL, "")
|
11
|
+
|
12
|
+
doc = Nokogiri(data)
|
13
|
+
meta = doc.at('meta[http-equiv=refresh]')
|
14
|
+
|
15
|
+
if meta.nil?
|
16
|
+
raise ConnectionError, PROTOCOL_ERROR
|
17
|
+
end
|
18
|
+
|
19
|
+
forward = meta['content'].split('URL=').last
|
20
|
+
|
21
|
+
data, resp, self.cookies, forward = get(forward, self.cookies)
|
22
|
+
|
23
|
+
doc = Nokogiri(data)
|
24
|
+
|
25
|
+
self.tid = doc.at('input[name=tid]')['value']
|
26
|
+
url = doc.at('form[name=login]')['action']
|
27
|
+
|
28
|
+
postdata = "appid=0158&lang=de&login=Login&pwd=%s&skinid=30&tid=%s&usr=%s" % [
|
29
|
+
CGI.escape(password),
|
30
|
+
CGI.escape(self.tid),
|
31
|
+
CGI.escape(username)
|
32
|
+
]
|
33
|
+
|
34
|
+
data, resp, self.cookies, forward = post(url, postdata, self.cookies)
|
35
|
+
|
36
|
+
if forward.nil? || !forward.match("loadUser")
|
37
|
+
raise AuthenticationError, "Username and password do not match"
|
38
|
+
end
|
39
|
+
|
40
|
+
data, resp, self.cookies, forward = get(forward, self.cookies)
|
41
|
+
end
|
42
|
+
|
43
|
+
def contacts
|
44
|
+
@contacts = []
|
45
|
+
|
46
|
+
data, resp, self.cookies, forward = get(ADDRESS_BOOK_URL, self.cookies)
|
47
|
+
|
48
|
+
CSV.parse(data) do |row|
|
49
|
+
other, first_name, last_name, email = row
|
50
|
+
|
51
|
+
name = "#{first_name} #{last_name}".strip
|
52
|
+
email.strip!
|
53
|
+
|
54
|
+
next unless email.include?('@')
|
55
|
+
|
56
|
+
@contacts << [name, email]
|
57
|
+
end
|
58
|
+
|
59
|
+
@contacts
|
60
|
+
end
|
61
|
+
|
62
|
+
def skip_gzip?
|
63
|
+
false
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def username
|
69
|
+
@login.split('@').first
|
70
|
+
end
|
71
|
+
|
72
|
+
def domain
|
73
|
+
@login.split('@').last
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
TYPES[:tmobile_de] = TmobileDe
|
78
|
+
end
|
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.16
|
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-20 00:00:00.000000000Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: json
|
20
|
-
requirement: &
|
20
|
+
requirement: &8908780 !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: *8908780
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: gdata_19
|
31
|
-
requirement: &
|
31
|
+
requirement: &8907780 !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: *8907780
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: nokogiri
|
42
|
-
requirement: &
|
42
|
+
requirement: &8906900 !ruby/object:Gem::Requirement
|
43
43
|
none: false
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
@@ -47,10 +47,10 @@ dependencies:
|
|
47
47
|
version: 1.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
|
-
version_requirements: *
|
50
|
+
version_requirements: *8906900
|
51
51
|
description: A universal interface to grab contact list information from Yahoo, AOL,
|
52
|
-
Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.it, sezname.cz. Now supporting
|
53
|
-
1.9.
|
52
|
+
Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.it, sezname.cz, tmobile.de. Now supporting
|
53
|
+
Ruby 1.9.
|
54
54
|
email: zan@liangzan.net
|
55
55
|
executables: []
|
56
56
|
extensions: []
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/contacts/gmail.rb
|
63
63
|
- lib/contacts/plaxo.rb
|
64
64
|
- lib/contacts/onelt.rb
|
65
|
+
- lib/contacts/tmobile_de.rb
|
65
66
|
- lib/contacts/yahoo.rb
|
66
67
|
- lib/contacts/seznam.rb
|
67
68
|
- lib/contacts/hotmail.rb
|
@@ -98,5 +99,5 @@ rubygems_version: 1.8.10
|
|
98
99
|
signing_key:
|
99
100
|
specification_version: 3
|
100
101
|
summary: grab contacts from Yahoo, AOL, Gmail, Hotmail, Plaxo, GMX.net, Web.de, inbox.it,
|
101
|
-
seznam.cz
|
102
|
+
seznam.cz, tmobile.de
|
102
103
|
test_files: []
|