contacts_cn 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
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", "Wolfer"]
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
@@ -1,8 +1,8 @@
1
1
  require File.dirname(__FILE__)+"/../lib/contacts_cn"
2
- =begin
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
- p Contacts.new(:sina,'nonobo_t@sina.cn','123456').contacts
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
@@ -9,7 +9,7 @@ require "erb"
9
9
 
10
10
  class Contacts
11
11
  TYPES = {}
12
- VERSION = "1.2.5"
12
+ VERSION = "1.2.6"
13
13
 
14
14
  class Base
15
15
  def initialize(login, password, options={})
@@ -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
- unless data.match(/<a.*?(http.*?)main.jsp\?sid=(.*?)\">/)
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: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 5
10
- version: 1.2.5
9
+ - 6
10
+ version: 1.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lucas Carlson
14
- - Wolfer
14
+ - kame
15
15
  autorequire: contacts
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-20 00:00:00 +08:00
19
+ date: 2011-03-03 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency