The search_tweets() method in the Twitter class is currently incorrect. It is currently trying to search tweets by calling GET statuses/oembed, but the correct API call is GET search/tweets, as documented here:
https://dev.twitter.com/docs/api/1.1/get/search/tweets
Also, the Twitter class's get_statuses() method is incorrectly parsing the results of GET search/tweets.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | twitter_1963524_12.patch | 1.52 KB | xano |
| #8 | fix_search_tweets-1963524-8.patch | 1.46 KB | sheldon rampton |
| #6 | fix_search_tweets-1963524-6.patch | 1.46 KB | sheldon rampton |
| #4 | fix_search_tweets-1963524-4.patch | 1.26 KB | sheldon rampton |
| #1 | fix_search_tweets-1963524-1.patch | 1.25 KB | sheldon rampton |
Comments
Comment #1
sheldon rampton commentedHere's a patch that fixes this issue.
Comment #2
lukusWorks well for me. Thanks very much :)
Comment #3
juampynr commentedPlease re-roll for 7.x-6.x.
Comment #4
sheldon rampton commentedOK, here's a 7.x-6.x version.
@juampy, in the future, I'll plan on creating a 7.x-6.x version for any patches that I submit, which can then be backported as needed to 7.x-5.x and 6.x-5.x. However, I may first post a patch that corresponds to the module version where I first encounter a need to patch something.
Comment #5
juampynr commentedHere are some comments from my review.
Please add docblocks as per Doxygen coding standards (http://drupal.org/node/1354). You can see examples in other functions of this file.
wrap array index checks with isset() to avoid warnings.
If search is just to be done on search/tweets path within the Twitter API, we could remove this attribute and just use this path within get_search_results(), don't you think so?
Comment #6
sheldon rampton commentedOK, here's an updated patch.
Comment #7
juampynr commentedCommitted. Thanks!
Just fixed a typo with the return array of get_search_resuls().
http://drupalcode.org/project/twitter.git/commit/718fd61
Feel free to reopen with a patch for 7.x-5.x.
Comment #8
sheldon rampton commentedOK, here's a backport of the patch for 7.x-5.x.
Comment #9
sheldon rampton commented@juampy: Can you review and apply this patch? It's a straightforward backport of the version for 7.x-6.x, and it fixes a bug that I need fixed for my twitter_search module to work properly.
Comment #10
sheldon rampton commented@juampy: Can you please take a look at this patch and commit it? I submitted it back in April, and I think it's very straightforward, so it should be easy for you to review and act on it.
Comment #11
xanoBump. I'd like to provide a patch for 6.x-5.x once this is fixed in 7.x-5.x.
Comment #12
xanoThis patch applies to 6.x-5.x and is a straight backport from the fix provided by Sheldon in #8. I confirmed that this works like a charm.
Comment #13
SebCorbin commentedBumping priority
Comment #14
socialnicheguru commentedthis is included in the feb dev version