python-twitter-tools / twitter

Python Twitter API
http://mike.verdone.ca/twitter/
MIT License
3.19k stars 715 forks source link

Error on "twitter search" #280

Open hillz1 opened 9 years ago

hillz1 commented 9 years ago

When I execute "twitter search mykeyword" it returns this error,http://s15.postimg.org/3wwdegnkr/angel_beats_bg5.jpg seems that you're still using API v1 on that twitter search, please update it to the latest version

Zearin commented 8 years ago

:+1: Just happened to me, too. Weird…!

RouxRC commented 8 years ago

The whole Search action through the command line client is completely outdated (see https://github.com/sixohsix/twitter/blob/master/twitter/cmdline.py#L469-L486 ) and should be completely rewirtten using the classical api route, it should be quite easy to do.

OAuthBringer commented 8 years ago

So, I've pushed a hotfix on my fork of the repo here

I've got something working for my own purposes for the moment, but I was unable to track the source of the issue. There are some trickle down formatting issues that will need to be resolved in the API update including date formats and key lookups.

The redefinition of twitter.domain is now unnecessary as the search api follows the same root domain as everything else. The issue is that search is being added as a uriparts somewhere between the SearchAction and the TwitterCall. I'm assuming this is in the search method itself, but I was unable to identify where this is actually defined, and ultimately I got tired of running down the rabbit hole. I'd be happy to patch it if someone who knows the lib a bit more can point me in the direciton of the Twitter().search() method definition, or explain how/where it is that the search term is being added to uriparts

I tried overwriting it in SearchAction itself, but this is too early in the process.

RouxRC commented 8 years ago

Hi, Cool you started fixing it. However, there's no reason to do such a dirty hack, you can simply call the twitter search route by doing : twitter.search.tweets(args). @sixohsix built this lib so that calling any route remains generic whatever twitter decides to change :) (basically undefined methods are recursively added to uriparts)

RouxRC commented 8 years ago

see here https://github.com/sixohsix/twitter/blob/master/twitter/api.py#L195-L208

OAuthBringer commented 8 years ago

Ah, that clarifies things a great deal. That is pretty straightforward. I'll patch that and push something up soon. I still want to understand the inputs as some of the search action options are non functional.

On Sun, Jul 24, 2016, 9:36 AM Benjamin Ooghe-Tabanou < notifications@github.com> wrote:

see here https://github.com/sixohsix/twitter/blob/master/twitter/api.py#L195-L208

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sixohsix/twitter/issues/280#issuecomment-234780607, or mute the thread https://github.com/notifications/unsubscribe-auth/AIZ79cmXh8MzdZlIGfo3J-_-O1lOErMeks5qY3hVgaJpZM4Dkq4N .