Class: Blogpost::Cocolog

Inherits:
Object
  • Object
show all
Defined in:
lib/blogpost/cocolog.rb

Class Method Summary collapse

Class Method Details

.post(opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/blogpost/cocolog.rb', line 3

def self.post(opts={})
  opts = Blogpost.options.merge(opts)
  host="https://app.f.cocolog-nifty.com/t/api"
  # id = XMLRPC::Client.new2(host).call("blogger.getUsersBlogs", "", opts[:user], opts[:pass])[0]["blogid"]
  XMLRPC::Client.new2(host).call("metaWeblog.newPost", opts[:blogid], opts[:user], opts[:pass],
  # XMLRPC::Client.new2(host).call("metaWeblog.newPost", id, opts[:user], opts[:pass],
    {"title" => opts[:title],"description" => opts[:content]}, true)
end