This project has moved and is read-only. For the latest updates, please go here.

how to select all my followers who have at least tweeted in the last week

Apr 23, 2013 at 7:18 AM
how can i get all my followers who have at least tweeted in the last week

here are the two queries i use to get the data, but how can i combine two queries into just one query!

//this gets all my followers
result = (from friend in twitterCtx.SocialGraph
                          where friend.Type == SocialGraphType.Followers &&
                           friend.ScreenName == HiddenFieldUserName.Value
                          orderby friend.IDs ascending
                          select friend).FirstOrDefault();

//this gets the user profile of all the ids in "alluserid" but I only want followers who have tweeted at least in the last week inside the "alluserid"...
var users =
               (from user in twitterCtx.User
                where user.Type == UserType.Lookup &&
                      user.UserID == alluserid

                select user)
whomever is reading this, I really appreciate your help.

thank you so much

also here is the site that I am creating. its a twitter broadcaster
Apr 23, 2013 at 5:01 PM
Edited Apr 23, 2013 at 5:01 PM

The unfortunate answer is that you can't combine the two queries into one. This is how the Twitter endpoints are set up. That said, I'll throw out a couple ideas and see if anything works for you.
  • Use a StatusType.Home query, which gets the tweets for an authenticated user and their friends. You can read the timeline back for a week by looking at the date of the earliest tweet in the list. Just filter out the user's tweets. For more info, see my blog post on Working with Timelines with LINQ to Twitter.
  • Use a StreamType.User, which is a Twitter user stream. You would need to have this running all the time to collect the tweets in real time. Twitter will release Site Streams soon, which LINQ to Twitter supports as StreamType.SiteStream.
Got your site,, on my Sites List.

Apr 24, 2013 at 3:46 AM
Thank you joe that worked like a charm!!! very powerful!!