contacts_cn 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/examples/grab_contacts.rb +12 -4
- data/lib/contacts/base.rb +1 -1
- data/lib/contacts/net_ease.rb +4 -1
- metadata +5 -5
data/Rakefile
CHANGED
@@ -71,7 +71,7 @@ spec = Gem::Specification.new do |s|
|
|
71
71
|
|
72
72
|
#### Author and project details.
|
73
73
|
|
74
|
-
s.authors = ["Lucas Carlson", "
|
74
|
+
s.authors = ["Lucas Carlson", "kame"]
|
75
75
|
s.email = ["lucas@rufy.com,","kamechb@gmail.com"]
|
76
76
|
s.homepage = "http://rubyforge.org/projects/contacts"
|
77
77
|
end
|
data/examples/grab_contacts.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require File.dirname(__FILE__)+"/../lib/contacts_cn"
|
2
|
-
|
2
|
+
|
3
3
|
login = ARGV[0]
|
4
4
|
password = ARGV[1]
|
5
|
-
|
5
|
+
#login is your email
|
6
6
|
Contacts::Gmail.new(login, password).contacts
|
7
7
|
|
8
8
|
Contacts.new(:gmail, login, password).contacts
|
@@ -10,6 +10,14 @@ Contacts.new(:gmail, login, password).contacts
|
|
10
10
|
Contacts.new("gmail", login, password).contacts
|
11
11
|
|
12
12
|
Contacts.guess(login, password).contacts
|
13
|
-
=end
|
14
13
|
|
15
|
-
|
14
|
+
Contacts.new(:yahoo,login,password).contacts
|
15
|
+
|
16
|
+
Contacts.new(:hotmail,login,password).contacts
|
17
|
+
|
18
|
+
#net_ease support 163.com, 126.com, yeah.net
|
19
|
+
Contacts.new(:net_ease,login,password).contacts
|
20
|
+
|
21
|
+
Contacts.new(:sina,login,password).contacts
|
22
|
+
|
23
|
+
Contacts.new(:sohu,login,password).contacts
|
data/lib/contacts/base.rb
CHANGED
data/lib/contacts/net_ease.rb
CHANGED
@@ -102,7 +102,10 @@ class Contacts
|
|
102
102
|
#get mail server and sid
|
103
103
|
enter_mail_url = ENTER_MAIL_URL[@mail_type] % @login
|
104
104
|
data, resp, cookies, forward = get(enter_mail_url,@cookies)
|
105
|
-
|
105
|
+
location = resp['Location']
|
106
|
+
data_reg = /<a.*?(http.*?)main.jsp\?sid=(.*?)\">/
|
107
|
+
location_reg = /(http.*?)main.jsp\?sid=(.*)/
|
108
|
+
unless data.match(data_reg) || location.match(location_reg)
|
106
109
|
raise ConnectionError, self.class.const_get(:PROTOCOL_ERROR)
|
107
110
|
end
|
108
111
|
@cookies = cookies
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contacts_cn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 6
|
10
|
+
version: 1.2.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lucas Carlson
|
14
|
-
-
|
14
|
+
- kame
|
15
15
|
autorequire: contacts
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2011-03-03 00:00:00 +08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|