tumblr / tumblr_client

A Ruby Wrapper for the Tumblr v2 API
Apache License 2.0
224 stars 86 forks source link

client.follow returns empty array [] #33

Closed frankelia closed 10 years ago

frankelia commented 10 years ago
require 'tumblr_client'

client = Tumblr::Client.new({
    # my config stuff
})

puts client.info # works

puts client.follow('http://non-existent-tumblr-url000.tumblr.com') # => {"status"=>404, "msg"=>"Not Found"}
puts client.follow('http://collegehumor.tumblr.com') # => []

Shouldn't be an authorization issue since I can do everything else. The account its not followed (it's not just the response that's empty).

ceyko commented 10 years ago

I tried executing this myself and didn't have any issues. Can you try the following sample and paste the output?

irb(main):030:0> client.following['blogs'].map{|x| x['name']}.grep('collegehumor')
=> []
irb(main):031:0> client.follow('http://collegehumor.tumblr.com')
=> []
irb(main):032:0> client.following['blogs'].map{|x| x['name']}.grep('collegehumor')
=> ["collegehumor"]
frankelia commented 10 years ago

You're right. It actually follows people, I guess I was just confused by the empty return cause I was expecting something different.

codingjester commented 10 years ago

I kinda agree that this was a poor response when I designed the client. We probably should have it return a boolean or some other structured object that it actually succeeded since [], definitely gives the indication that it failed.

Lame sauce.