Adding User....

0 views
Skip to first unread message

Carl Crawley

unread,
Aug 12, 2008, 12:06:53 PM8/12/08
to twitter...@googlegroups.com
Hi All,

Is anyone getting any errors when running a Client.friend?

I'm getting :

*Bad Request (Twitter::RESTError)

*when trying running:

Client.friend(:add,'friendname')

I'm wondering if something has changed in the Twitter API that's causing
this to error?

Regards,

Carl.

P.S: If it helps, I'm also using 'mbbx6spp-twitter4r-0.3.1'

jeff

unread,
Aug 12, 2008, 3:42:35 PM8/12/08
to twitter4r-users
I also just started getting this error. Its pretty new since i know
this was working sometime last week.

Carl Crawley

unread,
Aug 13, 2008, 5:13:59 AM8/13/08
to twitter...@googlegroups.com
jeff wrote:
> I also just started getting this error. Its pretty new since i know
> this was working sometime last week.
>
>

Hi Jeff,

Yeah - I know that twitter changed the way the API worked recently, but
I didn't think we would be affected by it.

Rgds,

C.

jeff

unread,
Aug 13, 2008, 5:23:36 PM8/13/08
to twitter4r-users
Carl, can you point me to info about the api change?

thanks

S Potter

unread,
Aug 13, 2008, 8:02:42 PM8/13/08
to twitter...@googlegroups.com
Hi Carl & Jeff,

I am out of action until next Wednesday in a well [internet] connected
kind of way, but try to see if you can get commit a29a0cea to work in
GitHub. You can download the archive from the following URL:
http://github.com/mbbx6spp/twitter4r/tarball/a29a0cea48f7ea3c2272ace7394023a32c19a67c

Otherwise I will be back to normal after next Wednesday.

HTH,
Susan

--
mailto:m...@susanpotter.net
www:http://susanpotter.net
blog:http://snakesgemscoffee.susanpotter.net
linkedin:http://www.linkedin.com/in/susanpotter

jeff

unread,
Aug 14, 2008, 9:48:36 AM8/14/08
to twitter4r-users
Thanks, Susan,

The tarball didn't work, but it looks like that hash is the same hash
as the development gem which doesn't work.

Hope to hear from you after Wednesday

On Aug 13, 7:02 pm, "S Potter" <mbbx6...@gmail.com> wrote:
> Hi Carl & Jeff,
>
> I am out of action until next Wednesday in a well [internet] connected
> kind of way, but try to see if you can get commit a29a0cea to work in
> GitHub.  You can download the archive from the following URL:http://github.com/mbbx6spp/twitter4r/tarball/a29a0cea48f7ea3c2272ace7...

Carl Crawley

unread,
Aug 19, 2008, 7:10:15 AM8/19/08
to twitter...@googlegroups.com
jeff wrote:
> I also just started getting this error. Its pretty new since i know
> this was working sometime last week.
>
>

Hi Jeff,

I've managed to fix this issue - not sure why/how it occurs, but got it
working nonetheless (I think).

look for your frienship.rb file in your RubyGems and change the line :

response = http_connect {|conn| create_http_get_request(uri) }

to

response = http_connect {|conn| create_http_post_request(uri) }

Apparently, the friendship module on the API now needs to be posted
rather than a get request....

If Susan can confirm that this looks ok for me - I would be much
appreciated...

Regards,

Carl.

jeff

unread,
Aug 19, 2008, 12:24:36 PM8/19/08
to twitter4r-users
that's it, carl, thanks!

i just monkeypatched Twitter::Client in my environment.rb until the
gem is updated

class Twitter::Client
def friend(action, value)
raise ArgumentError, "Invalid friend action provided: #{action}"
unless @@FRIENDSHIP_URIS.keys.member?(action)
value = value.to_i unless value.is_a?(String)
uri = "#{@@FRIENDSHIP_URIS[action]}/#{value}.json"
response = http_connect {|conn| create_http_post_request(uri) }
bless_model(Twitter::User.unmarshal(response.body))
end
end
Reply all
Reply to author
Forward
0 new messages