Search result statuses does not have ScreenName

Jul 20, 2013 at 3:57 PM
I am trying to search twitter using the following code:
var searchResult =
                (
                    from search in TwitterCtx.Search
                    where search.Type == SearchType.Search &&
                          search.Query == query &&
                          search.Count == pageSize
                    select search
                ).SingleOrDefault();

            resultList = searchResult.Statuses;
I am facing two problems:
the first I cant get the same results as the results I get when I search the same query in the twitter website. (for example I try the query "klksn" and you can see the difference between the result I get from the application and the result I get from the twitter.com website).
the second is when I am iterating through the statuses I find that status.ScreenName is null and I can't get the screen name of the user.
Please help me.
Coordinator
Jul 21, 2013 at 4:01 AM
Hi,

For paging through results, you can read my blog post: Working with Timelines with LINQ to Twitter.

For User ID info, see User.Identifier.ScreenName. It's in the LINQ to Twitter FAQ too.

@JoeMayo
Jul 24, 2013 at 7:55 AM
Edited Jul 24, 2013 at 7:58 AM
Thank you for your response, it was helpful. I was able to retrieve the screen name just like you said, but the main problem remains unsolved. In the example you mentioned, it retrieves tweets of a specific user, but this is not my case, I want to user the Twitter search functionality, and I am aware of the maxId and sinceId thing but this is not the problem here, my problem is the when I search using the following code for example:
var searchResult =
                (
                    from search in TwitterCtx.Search
                    where search.Type == SearchType.Search &&
                          search.Query == "klksn" &&
                          search.Count == 100 &&
                          search.IncludeEntities == false
                    select search
                ).SingleOrDefault();

            resultList = searchResult.Statuses;
the result is different when I search using Twitter website: https://twitter.com/search/realtime?q=klksn&src=typd

Please try this example and you'll see that using the code brings about 12 entries but using the Twitter website brings much more.
I appreciate your help. Thank you.
Jul 24, 2013 at 7:50 PM
Edited Jul 24, 2013 at 7:52 PM
Another problem when running the following query if you comment out either the SinceID or the MaxID clause it executes ok, but when both are included a "Missing or invalid url parameter" exception is generated.
var searchResult =
                (
                    from search in TwitterCtx.Search
                    where search.Type == SearchType.Search &&
                          search.Query == query &&
                          search.Count == pageSize &&
                          search.IncludeEntities == true &&
                          search.ResultType == ResultType.Recent &&
                          search.MaxID == maxId &&
                          search.SinceID == sinceId
                    select search
                ).SingleOrDefault<Search>();