Closed (won't fix)
Project:
Twitter
Version:
6.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 13:47 UTC
Updated:
2 Apr 2013 at 13:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedI would absolutely love to see this as well. I love everything about the twitter module. Adding this feature would really complete it's feature set.
Thanks!
Comment #2
Flplsx commentedThis feature would bring the module into a whole new class of awesome!
Comment #3
lyricnz commentedThe (not insurmountable) problems are:
- search uses a separate URL http://search.twitter.com
- the results are not the the same format as other methods in the same API, requiring unique theming/presentation
That being said, I'm using the following code in one of my modules:
This probably doesn't support ALL the ways results can arrive (multiple links, images, etc), but works pretty well for me. If module maintainer is interested in adding search to twitter, this might be a useful start.
Comment #4
abraham commentedTwitter is planning on unifying the data objects on their REST and Search APIs sometime this year: http://apiwiki.twitter.com/FAQ#AreyougoingtomaketheRESTAPIandtheSearchAP...
Comment #5
littleviking001 commentedHere's a patch that's been working well for me. It adds a field for a global search string on the admin/settings/twitter page.
---
Developed by ActiveLAMP, sponsored by Causecast
Comment #6
bdwelle commented+1 on this feature
I installed the patch and it seems to work fine.
thx!
Comment #7
dragonwize commentedI've created a module using some of the ideas and code here with some additions and modifications of my own. It still needs a little work and more testing. Volunteers welcome: http://drupal.org/project/twitter_search
Comment #8
sirkitree commentedMarking as needs review.
Comment #9
xurizaemonThis attached patch adds a twitter_search() function to twitter.inc, which you can pass terms into.
And it adds a twitter_fetch_search() function which stores the results locally too.
Eg,
Comment #10
xurizaemonThere are >= three separate approaches in this issue now. Thought I should explain why I was adding another rather than building on one of them.
LittleViking's patch in #5 adds a global search variable, and calls twitter_fetch_search() on cron runs using this term. It stores them using twitter_cache_status() which may be from an earlier version of this module (function doesn't exist in twitter-6.x-3.x CVS) or may be custom code at their end.
LyricNZ's code posted above re-implements the facility using drupal_http_request() and SimpleXML parser rather than adding facilities to Twitter module. It's suitable if you want to drop the code into your site without changing how Twitter module works.
DragonWize's code expands on LittleViking's (dragon, viking, are you guys in cahoots?) but I wanted this functionality available through the Twitter libs in this module.
twitter.lib.php already included stub code for TwitterSearch, it just wasn't implemented. None of the above approaches had used that (that I could see).
I feel that the most useful modules are the toolkits which allow us to build solutions on top of, rather than providing a canned solution which may or may not scratch your particular itch. So I've aimed to move this contribution in the toolkit direction, rather than towards a particular end solution.
Comment #11
xurizaemonI left out a bit of code :) Also: More ramblings.
I added TwitterSearchStatus class to handle http://code.google.com/p/twitter-api/issues/detail?id=214 which is mentioned in Twitter's API docs. This class turns TwitterSearch results into TwitterStatus objects.
Because of the code to fetch users in TwitterSearchStatus's __construct() we may use more API requests than required (we do 1 or 2 additional users/show API hits per search result). Could drop that if not required. We do get the user's name, just not their twitter UID.
This code does not handle authenticated searches. (Does Twitter?)
Comment #12
13rac1 commentedPatch needs updating for 6.x-5.x.
Comment #13
tinkerbelle commentedI would looooove to see this functionality added to this module (or find an alternative), now that Twitter has/is about to remove their RSS & Atom feeds.
Comment #14
juampynr commentedAFAIK Twitter Pull module can do this.
Comment #15
tinkerbelle commentedYep, thanks, I did end up using Twitter Pull.
For anyone interested, the dev version of that module is currently dealing with Twitter's recent/upcoming api changes by piggybacking on this module's (and thus also the OAuth module's) api -- see #1781024: Make the Twitter Pull module work when Twitter turns off the version 1 API and #1899456: Separate the API, User features and views features into their own respective modules..
Comment #16
lukusI'd second the request for this functionality to be added to this module.
The need to use twitter_pull on top of this module, takes away some of the original appeal of using twitter_pull in the first place (e.g. it being lightweight / simple to implement).
Almost two and a half years have passed since this issue was last looked at in terms of code. Is it worth raising a new issue?