contactlist-client 0.1.0 → 0.1.1
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/README.textile +1 -1
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/lib/contactlist/client.rb +8 -8
- metadata +5 -5
data/README.textile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
h1. contactlist-client
|
2
2
|
|
3
|
-
The contactlist-client gem is a ruby client to "contactlist":http://github.com/flyerhzm/contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah and
|
3
|
+
The contactlist-client gem is a ruby client to "contactlist":http://github.com/flyerhzm/contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)
|
4
4
|
|
5
5
|
**********************************************************
|
6
6
|
|
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ begin
|
|
5
5
|
require 'jeweler'
|
6
6
|
Jeweler::Tasks.new do |gem|
|
7
7
|
gem.name = "contactlist-client"
|
8
|
-
gem.summary = %Q{The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah and
|
9
|
-
gem.description = %Q{The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah and
|
8
|
+
gem.summary = %Q{The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)}
|
9
|
+
gem.description = %Q{The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)}
|
10
10
|
gem.email = "flyerhzm@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/flyerhzm/contactlist-client"
|
12
12
|
gem.authors = ["Richard Huang"]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/contactlist/client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'net/https'
|
2
3
|
require 'uri'
|
3
4
|
|
4
5
|
require 'rubygems'
|
@@ -7,13 +8,13 @@ require 'json'
|
|
7
8
|
module ContactList
|
8
9
|
class Client
|
9
10
|
|
10
|
-
REQUEST_URI = 'http://contacts.huangzhimin.com/'
|
11
|
+
#REQUEST_URI = 'http://contacts.huangzhimin.com/'
|
11
12
|
#REQUEST_URI = 'http://localhost:8080/ContactListService/contacts'
|
12
13
|
|
13
14
|
Contact = Struct.new(:username, :email)
|
14
15
|
|
15
16
|
def self.fetch(account, password, type)
|
16
|
-
response = get_response(
|
17
|
+
response = get_response("account=#{account}&password=#{password}&type=#{type}")
|
17
18
|
contacts = []
|
18
19
|
data = JSON.parse(response.body)
|
19
20
|
|
@@ -26,12 +27,11 @@ module ContactList
|
|
26
27
|
end
|
27
28
|
|
28
29
|
private
|
29
|
-
def self.get_response(
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
response
|
30
|
+
def self.get_response(data)
|
31
|
+
http = Net::HTTP.new('121.22.4.157', 8443)
|
32
|
+
http.use_ssl = true
|
33
|
+
path = '/ContactListService/contacts'
|
34
|
+
response = http.post2(path, data)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contactlist-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
@@ -9,11 +9,11 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-06 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description: The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah and
|
16
|
+
description: The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)
|
17
17
|
email: flyerhzm@gmail.com
|
18
18
|
executables: []
|
19
19
|
|
@@ -59,7 +59,7 @@ rubyforge_project:
|
|
59
59
|
rubygems_version: 1.3.5
|
60
60
|
signing_key:
|
61
61
|
specification_version: 3
|
62
|
-
summary: The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah and
|
62
|
+
summary: The contactlist-client gem is a ruby client to contactlist service which retrieves contact list of email(hotmail, gmail, yahoo, sohu, sina, 163, 126, tom, yeah, 189 and 139) and im(msn)
|
63
63
|
test_files:
|
64
|
-
- test/contactlist-client_test.rb
|
65
64
|
- test/test_helper.rb
|
65
|
+
- test/contactlist-client_test.rb
|