如何调用特定的tumblr响应?

时间:2015-07-18 07:53:59

标签: ruby-on-rails ruby client response tumblr

我尝试只接收来自tumplr帖子或博客的某些回复。例如:

client = Tumblr::Client.new({
  :consumer_key => 'xxx',
  :consumer_secret => 'xxx',
  :oauth_token => 'xxx',
  :oauth_token_secret => 'xxx'
})

myblog = client.posts

puts myblog["posts"].each do |posts|
    puts posts["id"]
end

我收到错误:

/Users/xxx/.rvm/gems/ruby-2.2.0/gems/tumblr_client-0.8.5/lib/tumblr/blog.rb:32:in帖子&#39;:错误的参数数量(0表示1..2)(ArgumentError)     来自tumblr.rb:42:<main>''

...我试图能够调用特定的响应,而不是获取您通常会收到的大量帖子信息。拜托,谢谢你的帮助。 :)

1 个答案:

答案 0 :(得分:1)

尝试更改:

myblog = client.posts

myblog = client.posts(“yourblog.tumblr.com”)

https://github.com/tumblr/tumblr_client/blob/master/README.md