Monday

jsonarray example in c#


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++)
{

//jsonArray["results"][0]["created_at"]
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(),
// KwmimDate = DateTime.Parse(jsonArray["results"][i]["created_at"].ToString()), // entry.Published,
RecordCreated = DateTime.Now
};
ret.Add(author);
}


return ret;

}


No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...