Wassruby 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/example/example.rb +11 -6
- data/lib/wassruby.rb +2 -4
- metadata +2 -2
data/example/example.rb
CHANGED
@@ -5,14 +5,19 @@ user_id = "YOUR WASSR ID"
|
|
5
5
|
pass = "PASSWORD"
|
6
6
|
|
7
7
|
client = WWW::Wassr.new(user_id, pass)
|
8
|
-
client.post("test")
|
8
|
+
client.post(:update, "test")
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
WWW::Wassr.start(user_id, pass) { |client|
|
11
|
+
client.post(:update, "test")
|
12
|
+
}
|
13
13
|
|
14
14
|
puts "PUBLICK TIMELINE"
|
15
|
-
puts WWW::Wassr.get(:public_timeline)
|
15
|
+
puts WWW::Wassr.get(:public_timeline) #=> Array object
|
16
16
|
|
17
17
|
puts "USER TIMELINE #{user_id}"
|
18
|
-
puts WWW::Wassr.get(:user_timeline, user_id)
|
18
|
+
puts WWW::Wassr.get(:user_timeline, user_id) #=> Array object
|
19
|
+
|
20
|
+
#print user_login_id and html
|
21
|
+
v = WWW::Wassr.get(:public_timeline)
|
22
|
+
v.map{|i| puts " #{i["user_login_id"]} : #{i["html"]}" }
|
23
|
+
|
data/lib/wassruby.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#= Simple Wassr Client
|
2
2
|
#Authors:: Takuya Mannami
|
3
|
-
#Version:: 0.0.
|
3
|
+
#Version:: 0.0.9 (2009/11/25)
|
4
4
|
#License:: MIT License
|
5
5
|
|
6
6
|
# -*- coding: utf-8 -*-
|
@@ -13,7 +13,6 @@ require 'json'
|
|
13
13
|
|
14
14
|
module WWW
|
15
15
|
class Wassr
|
16
|
-
VERSION = '0.0.8'
|
17
16
|
WASSR = "api.wassr.jp"
|
18
17
|
WASSR_RUBY = "Wassruby"
|
19
18
|
WASSR_API_URL = {
|
@@ -37,7 +36,7 @@ module WWW
|
|
37
36
|
|
38
37
|
class << self
|
39
38
|
def start(login_id, password, &block)
|
40
|
-
block.call(
|
39
|
+
block.call(WWW::Wassr.new(login_id, password))
|
41
40
|
end
|
42
41
|
|
43
42
|
def get_res_body_json(api_add, id="")
|
@@ -73,7 +72,6 @@ module WWW
|
|
73
72
|
def post!(api_key, val)
|
74
73
|
req = Net::HTTP::Post.new(WASSR_API_URL[api_key] << CGI.escape(val) <<
|
75
74
|
"&source=" << WASSR_RUBY)
|
76
|
-
req[:user_agent] = WASSR_RUBY
|
77
75
|
req.basic_auth(@login_id, @password)
|
78
76
|
res = @http.request(req)
|
79
77
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Wassruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takuya Mannami
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-25 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|