Error retweeting

91 views
Skip to first unread message

paulFusion

unread,
Jan 24, 2010, 11:49:03 PM1/24/10
to tweepy
I'm fairly new to django, and I'm using tweepy to try to retweet.


auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(t.oauth_key, t.oauth_secret)
api = tweepy.API(auth)
status = api.retweet(message.twitter_id)


I've verified that the OAuth code I'm using is valid..
verify_credentials() returns a user object.
When I try to do an api.update_status('msg') that works too. But for
some reason I can't retweet.
I've verified that the id I'm passing in is numeric and a valid tweet.

Any ideas would be much appreciated.


Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in
get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/var/www/fairmediagroup.com/sharedwithme/broadcast/views.py" in
index
6. broadcasts = bc.start()
File "/var/www/fairmediagroup.com/sharedwithme/broadcast/models.py" in
start
41. status = api.retweet(message.twitter_id)
File "/usr/local/lib/python2.6/dist-packages/tweepy-1.5-py2.6.egg/
tweepy/binder.py" in _call
167. raise TweepError(error_msg)

Exception Type: TweepError at /broadcast/
Exception Value:

Josh Roesslein

unread,
Jan 24, 2010, 11:57:48 PM1/24/10
to twe...@googlegroups.com
Hello,

Could you try wrapping the code that's throwing the TweepError in a
try/catch and
see what error message it is throwing. I can't really tell what sort
of error is occurring from that
traceback. Hopefully we can get this figured out quickly.

Thanks,

Josh

paulFusion

unread,
Jan 25, 2010, 12:45:05 PM1/25/10
to tweepy
I had already tried that, but didn't have things coded right for the
message to show up in my django view. I needed to str() the error
result.

So the status code I'm getting is "Twitter error response: status code
= 403"... which would make me think it's an auth issue, but again - I
can post a new status update just fine.

Thanks,
-paul


On Jan 24, 11:57 pm, Josh Roesslein <jroessl...@gmail.com> wrote:
> Hello,
>
> Could you try wrapping the code that's throwing the TweepError in a
> try/catch and
> see what error message it is throwing. I can't really tell what sort
> of error is occurring from that
> traceback. Hopefully we can get this figured out quickly.
>
> Thanks,
>
> Josh
>

paulFusion

unread,
Jan 25, 2010, 9:31:11 PM1/25/10
to tweepy
Hooray for dumb mistakes. Turns out I was unintentionally trying to
retweet myself, so it makes perfect sense that the status code would
be forbidden. Just needed to filter my user list better.

Hope I didn't waste too much of your time, and thanks for the
fantastic library!

-paul

Josh Roesslein

unread,
Jan 25, 2010, 9:46:14 PM1/25/10
to twe...@googlegroups.com
Hey Paul,

Glad you finally figured it out. Good luck with your application!

Josh

Reply all
Reply to author
Forward
0 new messages