Wassruby 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. data/lib/wassruby.rb +8 -4
  2. metadata +1 -2
data/lib/wassruby.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #= Simple Wassr Client
2
2
  #Authors:: Takuya Mannami
3
- #Version:: 0.1.1 (2009/11/25)
3
+ #Version:: 0.1.2 (2009/11/25)
4
4
  #License:: MIT License
5
5
 
6
6
  # -*- coding: utf-8 -*-
@@ -38,13 +38,17 @@ module WWW
38
38
  def start(login_id, password, &block)
39
39
  block.call(WWW::Wassr.new(login_id, password))
40
40
  end
41
+
42
+ def get_body(api_add, id="")
43
+ Net::HTTP.new(WASSR, 80).get(WASSR_API_URL[api_add] << id).body
44
+ end
41
45
 
42
46
  def get_res_body_json(api_add, id="")
43
- JSON.parse(Net::HTTP.new(WASSR, 80).get(WASSR_API_URL[api_add] << id).body)
47
+ JSON.parse(get_body(api_add, id))
44
48
  end
45
49
 
46
50
  def get_res_body_rss(api_add, id="")
47
- RSS::Parser.parse(Net::HTTP.new(WASSR, 80).get(WASSR_API_URL[api_add] << id).body)
51
+ RSS::Parser.parse(get_body(api_add, id))
48
52
  end
49
53
 
50
54
  def get(key, id=nil)
@@ -58,7 +62,7 @@ module WWW
58
62
  when :new_channel
59
63
  get_res_body_rss(:NEW_CHANNEL)
60
64
  when :channel_check
61
- get_res_body_json(:CHANNEL_CHECK, id) if id != nil
65
+ get_res_body_json(:CHANNEL_CHECK, id) if id != nil
62
66
  when :sl_timeline
63
67
  get_res_body_json(:SL_TIMELINE)
64
68
  when :user_channel_list
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.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuya Mannami
@@ -26,7 +26,6 @@ files:
26
26
  - example/example.rb
27
27
  - example/example2.rb
28
28
  - README.txt
29
- - test/test1.rb
30
29
  has_rdoc: true
31
30
  homepage: http://wassruby.rubyforge.org/
32
31
  licenses: