Take the 2-minute tour ×

Here's what I'm trying to do. I have a list of twitter users (2-3000) whose tweets I need to monitor for keywords.

I thought of two solutions to implement that but don't think any is optimal.

1- Create a private list on twitter, add all the accounts i want to monitor and use the list api to get all the tweets

2- use the search or stream api to monitor all of twitter for my keywords and then cross check on my side with the list of users i have.

Are these the only ways to do it? any idea on how to be more efficient?

One thing to keep in mind, I need to keep the list of accounts I'm monitoring private. Every account holder can know he is followed but can't know who else is.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Yes. This is how I would do it:

1) create an account on twitter that will follow all these people

2) I presume you have this list of people stored somehow, parse/grep/format that data so you have a list of all their user_ids

3) create an twitter application for you to use

4) download you favorite languages most popular twitter library

5) authenticate your user with your application

6) create a simple little program that reads your list from 2 and works it's way through following those users. Put a sleep between these calls as you will be subject to rate limiting.

6) create a simple little program that reads your list from (2) and works it's way through adding each user to a private list, creating a new private list each time you hit the 500 cap. These calls are subject to rate limiting, so stagger or batch the calls over the required time window

7) now you simply query your timeline via the API and you are away.

Key thing is 2, if you have that list in some digital format(text file,database,someone else's followers) or somehow is able to calculated (read:avoid manual search and follow) , this should be a breeze.

I use java, you could do everything in my steps + your filtering requirements with scribe (auth library) and gson (Json parser) in a couple methods. In terms of cleanliness and efficiency, I think this fits the brief.

share|improve this answer
This is what I had in mind, but instead of following the people I am going to create a private list an add them to that list. –  chaft Sep 28 '11 at 9:50
Lists don't give you anything extra + they are capped to 500 members. –  markdsievers Sep 28 '11 at 9:58
There's one thing i forgot to mention, I need to have the list of accounts I'm following stay private. I can't have someone have access to the list of people I am following. I modified the question to reflect that. –  chaft Sep 29 '11 at 8:03
@chaft Changed step 6 to accommodate additional requirement. –  markdsievers Oct 7 '11 at 11:40
After some experimenting i found out some interesting things, for some reason you cannot follow your own private lists, so there's no way to add people to a private list and follow that list. 2 every account is limited to creating 20 lists. –  chaft Jan 3 '12 at 21:34
add comment

You can use the stream API to follow multiple accounts, too, with the follow parameter, and then search by keyword on your end. That would be a lot more efficient.

You can also follow people with GET statuses/user_timeline, although it's only one user at a time. You can get 200 posts back in the past though.

I would do the streaming API, but also write some code to use user_timeline, in case your streaming receiving thing ever goes down you'll be able to quickly get anything you missed.

share|improve this answer
add comment

Your Answer


