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

Search Statuses In A List

Oct 8, 2012 at 11:44 AM

Is it possible to search Statuses in a List?

The only method I've found to do it is the rather clumsy way of extracting all the users from a list, then adding this to the Query (code below).

The problem is there's a limit to its length, so if the List has more than around 20 users in, the Search fails.

                    var lists =
                    (from list in twitterCtx.List
                     where list.Type == ListType.Members &&
                     list.OwnerScreenName == strUser &&
                     list.Slug == strList
                     select list);

                    if (lists != null)

                        foreach (var user in lists)

                            for (int i = 0; i < user.Users.Count; i++)
                                if (strFrom != "")
                                    strFrom += " OR ";

                                strFrom += "from:" + user.Users[i].Identifier.ScreenName;



                    var queryResultsText =
                    from search in twitterCtx.Search
                    where search.Type == SearchType.Search &&
                         search.WordOr == strSearch &&
                         search.WithRetweets == false &&
                         search.IncludeEntities == true &&
                         search.Query == strFrom &&
                         search.PageSize == 100
                    select search;

Oct 8, 2012 at 12:37 PM


Are you looking for something like this:

            var statusList =
                (from list in twitterCtx.List
                 where list.Type == ListType.Statuses &&
                       list.OwnerScreenName == "JoeMayo" &&
                       list.Slug == "dotnettwittterdevs" // name of list to get statuses for
                 select list)

Here's the docs on that:


Oct 8, 2012 at 12:41 PM

Thanks for such a quick reply.

Unless I've misunderstood it, the code above will return all statuses from users in a particular list.

I was looking to return statuses with a specific search term, from users in a particular list.