aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionwebservice/examples/metaWeblog/apis/blogger_service.rb')
-rw-r--r--actionwebservice/examples/metaWeblog/apis/blogger_service.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/actionwebservice/examples/metaWeblog/apis/blogger_service.rb b/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
new file mode 100644
index 0000000000..b79b53e6f7
--- /dev/null
+++ b/actionwebservice/examples/metaWeblog/apis/blogger_service.rb
@@ -0,0 +1,34 @@
+require 'blogger_api'
+
+class BloggerService < ActionWebService::Base
+ web_service_api BloggerAPI
+
+ def initialize
+ @postid = 0
+ end
+
+ def newPost(key, id, user, pw, content, publish)
+ $stderr.puts "id=#{id} user=#{user} pw=#{pw}, content=#{content.inspect} [#{publish}]"
+ (@postid += 1).to_s
+ end
+
+ def editPost(key, post_id, user, pw, content, publish)
+ $stderr.puts "id=#{post_id} user=#{user} pw=#{pw} content=#{content.inspect} [#{publish}]"
+ true
+ end
+
+ def getUsersBlogs(key, user, pw)
+ $stderr.puts "getting blogs for #{user}"
+ blog = Blog::Blog.new(
+ :url =>'http://blog',
+ :blogid => 'myblog',
+ :blogName => 'My Blog'
+ )
+ [blog]
+ end
+
+ def getUserInfo(key, user, pw)
+ $stderr.puts "getting user info for #{user}"
+ Blog::User.new(:nickname => 'user', :email => 'user@test.com')
+ end
+end