daum_oauth 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/Manifest CHANGED
@@ -2,9 +2,9 @@ README
2
2
  README.rdoc
3
3
  Rakefile
4
4
  lib/daum_oauth.rb
5
+ lib/daum_oauth/blog.rb
5
6
  lib/daum_oauth/cafe.rb
6
7
  lib/daum_oauth/client.rb
7
8
  lib/daum_oauth/yozm.rb
8
- test.rb
9
9
  text.rdoc
10
10
  Manifest
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('daum_oauth', '0.1.0') do |p|
5
+ Echoe.new('daum_oauth', '0.1.1') do |p|
6
6
  p.description = 'Daum OAuth API client library for ruby'
7
7
  p.url = 'http://github.com/thefron/daum_oauth'
8
8
  p.author = 'Hoseong Hwang'
data/daum_oauth.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{daum_oauth}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Hoseong Hwang"]
9
- s.date = %q{2010-10-29}
9
+ s.date = %q{2010-11-02}
10
10
  s.description = %q{Daum OAuth API client library for ruby}
11
11
  s.email = %q{thefron@wafflestudio.com}
12
- s.extra_rdoc_files = ["README", "README.rdoc", "lib/daum_oauth.rb", "lib/daum_oauth/cafe.rb", "lib/daum_oauth/client.rb", "lib/daum_oauth/yozm.rb"]
13
- s.files = ["README", "README.rdoc", "Rakefile", "lib/daum_oauth.rb", "lib/daum_oauth/cafe.rb", "lib/daum_oauth/client.rb", "lib/daum_oauth/yozm.rb", "test.rb", "text.rdoc", "Manifest", "daum_oauth.gemspec"]
12
+ s.extra_rdoc_files = ["README", "README.rdoc", "lib/daum_oauth.rb", "lib/daum_oauth/blog.rb", "lib/daum_oauth/cafe.rb", "lib/daum_oauth/client.rb", "lib/daum_oauth/yozm.rb"]
13
+ s.files = ["README", "README.rdoc", "Rakefile", "lib/daum_oauth.rb", "lib/daum_oauth/blog.rb", "lib/daum_oauth/cafe.rb", "lib/daum_oauth/client.rb", "lib/daum_oauth/yozm.rb", "text.rdoc", "Manifest", "daum_oauth.gemspec"]
14
14
  s.homepage = %q{http://github.com/thefron/daum_oauth}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Daum_oauth", "--main", "README"]
16
16
  s.require_paths = ["lib"]
@@ -0,0 +1,23 @@
1
+ #methods for blog
2
+
3
+ module DaumOAuth
4
+ class Client
5
+ def blog_post_list(blogName, options={})
6
+ puts "/blog/post/list.do?#{options.merge(:blogName => blogName, :output => 'json').collect{|k, v| "#{k}=#{v}"}.join('&')}"
7
+ get("/blog/post/list.do?#{options.merge(:blogName => blogName, :output => 'json').collect{|k, v| "#{k}=#{v}"}.join('&')}")
8
+ end
9
+
10
+ def blog_post_write(blogName, title, content, tag, options={})
11
+ post("/blog/post/write.do", options.merge(:blogName => blogName, :title => title, :content => content, :tag => tag, :output => 'json'))
12
+ end
13
+
14
+ def blog_post_modify(blogName, postId, title, content, tag, options={})
15
+ post("/blog/post/modify.do", options.merge(:blogName => blogName, :postId => postId, :title => title, :content => content, :tag => tag, :output => 'json'))
16
+ end
17
+
18
+ def blog_post_read(blogName, posdId)
19
+ post("/blog/post/read.do?blogName=#{blogName}&postId=#{postId}&output=json")
20
+ end
21
+
22
+ end
23
+ end
@@ -1,5 +1,7 @@
1
1
  require 'daum_oauth/yozm'
2
2
  require 'daum_oauth/cafe'
3
+ require 'daum_oauth/blog'
4
+ require 'uri'
3
5
 
4
6
  module DaumOAuth
5
7
  class Client
@@ -24,8 +24,8 @@ module DaumOAuth
24
24
 
25
25
  #send a message to yozm
26
26
  def yozm_add(message, options={})
27
- #post("/yozm/v1_0/message/add.json", options.merge(:message => message))
28
- post("/yozm/v1_0/message/add.json", {:message => message})
27
+ get("/yozm/v1_0/message/add.json?#{options.merge(:message => URI.encode(message)).collect{|k, v| "#{k}=#{v}"}.join('&')}")
28
+ #post("/yozm/v1_0/message/add.json", {:message => message})
29
29
  end
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daum_oauth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Hoseong Hwang
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-29 00:00:00 +09:00
18
+ date: 2010-11-02 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -29,6 +29,7 @@ extra_rdoc_files:
29
29
  - README
30
30
  - README.rdoc
31
31
  - lib/daum_oauth.rb
32
+ - lib/daum_oauth/blog.rb
32
33
  - lib/daum_oauth/cafe.rb
33
34
  - lib/daum_oauth/client.rb
34
35
  - lib/daum_oauth/yozm.rb
@@ -37,10 +38,10 @@ files:
37
38
  - README.rdoc
38
39
  - Rakefile
39
40
  - lib/daum_oauth.rb
41
+ - lib/daum_oauth/blog.rb
40
42
  - lib/daum_oauth/cafe.rb
41
43
  - lib/daum_oauth/client.rb
42
44
  - lib/daum_oauth/yozm.rb
43
- - test.rb
44
45
  - text.rdoc
45
46
  - Manifest
46
47
  - daum_oauth.gemspec
data/test.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'rubygems'
2
- require 'daum_oauth'
3
- Client = DaumOAuth::Client.new({:consumer_key => '90871bef-fefc-4078-ba9d-121a49c7099a', :consumer_secret => '89ct6-p-v-yqMOf7osfL7PQfnweAG68QepXRl4zn9quCIjrVcpZcZA00'})
4
- request_token = Client.request_token(:oauth_callback => 'http://wafflestudio.net/~thefron/callback.html')
5
- puts "authorize url: #{request_token.authorize_url}"
6
- oauth_verifier = gets.strip
7
- access_token = Client.authorize(request_token.token, request_token.secret, :oauth_verifier => oauth_verifier)