SinceId= 0 Not populating Search API

Jun 17, 2013 at 4:30 AM
Edited Jun 17, 2013 at 4:31 AM
Using LinqtoTwitter I am trying to do a search query as so:
Search Tweets=null;
Tweets = (from search in twitterCtx.Search where search.Type == SearchType.Search && search.ResultType == ResultType.Recent &&  search.Query == "to:"TwitterHandle +"since:" + Date  && search.Count == 100 select search).SingleOrDefault();
The problem is when I look at each Tweets object status the sinceId = 0? I am trying to grab the most recent tweet so I can store the SinceId and only go from their but it doesn't seem to be poplating. The other important things like StatusId and text have info but the SinceId is 0 for each status in Tweets.Statuses
Coordinator
Jun 17, 2013 at 4:34 AM
Hi,

I've seen problems with initially setting SinceID to 0. It might be because there is no ID #0. Maybe try 1 instead. Here's my blog post on Working with Timelines with LINQ to Twitter.

@JoeMayo
Jun 17, 2013 at 4:31 PM
So I should initially set the SinceId=0 even though this could be my first query for the twitter topic
Jun 17, 2013 at 4:40 PM
Also I took a look at your blog and it seems somehow confusing. You set the sinceId to some arbitrary high number and then you never seem to set it again in the do while loop but set the maxid to the min value? is the Min Id the oldest tweet returned status id? My approach is a little different. I plan on setting the SinceId to the most recent sinceId which I then in my do while loop checks the condition if SinceId!= 0 then include SinceId in the query? Is my approach wrong? If so help me understand yours because for mine the SinceId of earch status returned =0 so that won't work for me.
Jun 17, 2013 at 4:47 PM
Also another small question is it possible to combine multiple queries into one api call like so:

Search Tweets=null;
Tweets = (from search in twitterCtx.Search where search.Type == SearchType.Search && search.ResultType == ResultType.Recent &&  search.Query == "to:"TwitterHandle3 +"since:" + Date  && search.Count == 100 
 && search.Query == "to:"TwitterHandle1 +"since:" + Date  && search.Count == 100
 && search.Query == "to:"TwitterHandle2 +"since:" + Date  && search.Count == 100 select search);
So I can recieve the results for both queries in one api call to limit num of requests. If so then how would I iterate through the results?
Coordinator
Jun 18, 2013 at 11:21 PM
You might want to review the Twitter docs that I reference in my post too, which is a pre-requisite to my explanation and could clarify some things.

Your query won't work that way because you can only specify a parameter one time. You should build the string with all of the parameters you need and then use that string with Query.

@JoeMayo