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

Search not returning tweets

Aug 30, 2012 at 3:47 PM

Hi again, I've gotten the hang of using Linq to Twitter and have successfully managed to use it in one of my WP projects. However I've run into quite a snag with my current project wherein I'm searching for tweets between two people (from A to B and vice versa). Using the following code I can get tweets from my friend's Twitter account to mine, but not the other way around.

var FromToContext = new TwitterContext();

var FromToQuery =
     (from search in FromToContext.Search
      where search.Type == SearchType.Search &&
            search.PersonFrom == From &&
            search.PersonTo == To
            select search).AsyncCallback(tweets => Dispatcher.BeginInvoke(() =>
                         var results = tweets.ToList();
                         TweetsList.ItemsSource = null;
                         TweetsList.ItemsSource = tweets.Single().Results;

I've also tried searching for tweets from the Twitter accounts of my other friends (by setting just the PersonFrom or the PersonTo) just to test, both on a Console app and the WP, but even if the account isn't protected sometimes it doesn't return anything. The resulting query always has a count of 0.

Any help or insight on this issue is most appreciated. And thank you for answering my question last time.


Aug 30, 2012 at 4:29 PM

Hi Martin,

There are a couple things that might help to debug. First, I'd see what Twitter's Advanced Search page,!/search-advanced, returns. Then I would using your code above for searches between two different accounts.  Also, look at the contents of your From and To variables to see if you have any extra space characters or '@' symbol prefixes.


Sep 1, 2012 at 5:59 AM

Hi Joe,

I'm guessing that it's a limitation of Twitter's search, since I tried running the same search queries (searching for my Twitter account, twilightfallen, among other accounts) but I don't get any results back. Looks like I might have to find a workaround to my app.