public List<TwtAuthor> Search(string kw, int page)
{
List<TwtAuthor> ret = new List<TwtAuthor>();
string url =
string.Format(
"http://search.twitter.com/search.json?q={0}&rpp=100&include_entities=true&result_type=mixed&page{1}",kw.Replace(" ","%20"),page);
JsonObject jsonArray = JsonArray.Load(wl.GetStream(url)).ToJsonObject();
for (int i = 0; i < jsonArray["results"].Count; i++)
{
TwtAuthor author = new TwtAuthor()
{
name = jsonArray["results"][i]["from_user"].ToString().Replace("\"",""),
UserID = jsonArray["results"][i]["from_user_id"].ToString(),
KwmimText = jsonArray["results"][i]["text"].ToString(),
RecordCreated = DateTime.Now
};
ret.Add(author);
}
return ret;
}
No comments:
Post a Comment