I'm trying to get all tweets(count total tweet number) belong to hashtag. My function is here, how to I use maxID and sinceID for get all tweets. What is the instead of "count"? I dont'know.
if (maxid != null)
{
var searchResponse =
await
(from search in ctx.Search
where search.Type == SearchType.Search &&
search.Query == "#karne" &&
search.Count == Convert.ToInt32(count)
select search)
.SingleOrDefaultAsync();
maxid = Convert.ToString(searchResponse.SearchMetaData.MaxID);
foreach (var tweet in searchResponse.Statuses)
{
try
{
ResultSearch.Add(new KeyValuePair<String, String>(tweet.ID.ToString(), tweet.Text));
tweetcount++;
}
catch {}
}
while (maxid != null && tweetcount < Convert.ToInt32(count))
{
maxid = Convert.ToString(searchResponse.SearchMetaData.MaxID);
searchResponse =
await
(from search in ctx.Search
where search.Type == SearchType.Search &&
search.Query == "#karne" &&
search.Count == Convert.ToInt32(count) &&
search.MaxID == Convert.ToUInt64(maxid)
select search)
.SingleOrDefaultAsync();
foreach (var tweet in searchResponse.Statuses)
{
try
{
ResultSearch.Add(new KeyValuePair<String, String>(tweet.ID.ToString(), tweet.Text));
tweetcount++;
}
catch { }
}
}
}