|
|
@ -1,11 +1,9 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Net;
|
|
|
|
using System.Net;
|
|
|
|
using System.Web;
|
|
|
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace TwitterPractice.Controllers
|
|
|
|
namespace TwitterPractice.Controllers
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -29,16 +27,16 @@ namespace TwitterPractice.Controllers
|
|
|
|
{
|
|
|
|
{
|
|
|
|
username = "meatballhat";
|
|
|
|
username = "meatballhat";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ViewBag.UserTimeline = GetTwitterStream(username).Replace("\",", "\",\n");
|
|
|
|
ViewBag.UserTimeline = GetTwitterStream(username);
|
|
|
|
ViewBag.Username = username;
|
|
|
|
ViewBag.Username = username;
|
|
|
|
return View();
|
|
|
|
return View();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetTwitterStream(string username="meatballhat")
|
|
|
|
private JArray GetTwitterStream(string username="meatballhat")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string requestUrl = String.Format(requestTemplate, username);
|
|
|
|
string requestUrl = String.Format(requestTemplate, username);
|
|
|
|
WebClient req = new WebClient();
|
|
|
|
WebClient req = new WebClient();
|
|
|
|
return req.DownloadString(requestUrl);
|
|
|
|
return JArray.Parse(req.DownloadString(requestUrl));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|