It would be great if there was a way to search just within users you
are following, or those who are following you.

Currently the only way to do this is to get the latest 3200 tweets
from your friends and then search that result for your keyword. There
are 2 main drawbacks for this method:

i) You have to make 16 paged api requests to get the 3200 tweets, and
then process that data into arrays, etc. This is very slow, and not a
conservative way of using the api
ii) For less common search terms often no results will be returned as
there are no matches in the last 3200 tweets.

It seems that this should be possible as you can currently use search
srtings like:

however, this method is restricted to a few users, as there is a limit
of the number of characters you can have in the URL string.

How about having extra search paramaters like:
?q=keyword+following:user1 (returns all tweets mentioning 'keyword'
from users that 'user1' is following)


?q=keyword+followers:user1 (returns all tweets mentioning 'keyword'
from users that are following 'user1')

I had thought of another way around this for my app, which is:

Make an api call for all tweets from my timeline every 3 minutes
(using cron job)
Cache all new tweets in mysql database
Power my own searches against the twitter data in my own database

Drawbacks of this method would be:

i) have to store a lot of data in the db (and find a way of
automatically deleting tweets over a certain age)
ii) have to completely re-design my app from scratch

Has anyone else come up against this problem? I haven't been able to
find much mention about it on the development talk?
Is this a planned feature for the future?

Reply via email to