public IActionResult RedditPostData() { RedditDAL dl = new RedditDAL(); RedditPost p = dl.GetRedditPost(); return(View(p)); }
public ActionResult Index() { string text = RedditDAL.GetData(); RedditPost rp = new RedditPost(text, 0); return(View(rp)); }
public IActionResult Index() { RedditDAL dl = new RedditDAL(); string Json = dl.CallAPI(); ViewBag.data = Json; return(View()); }
public ActionResult Reddit() { HttpWebRequest request = WebRequest.CreateHttp("https://www.reddit.com/r/nba/.json"); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader rd = new StreamReader(response.GetResponseStream()); string data = rd.ReadToEnd(); List <RedditPost> output = RedditDAL.GetPosts(); return(View(output)); }
public ActionResult Index() { //HttpWebRequest request = WebRequest.CreateHttp("https://www.reddit.com/r/nba/.json"); //HttpWebResponse response = (HttpWebResponse)request.GetResponse(); //StreamReader rd = new StreamReader(response.GetResponseStream()); //string data = rd.ReadToEnd(); //JObject redditJson = JObject.Parse(data); //RedditPost p = new RedditPost(data, 0); RedditPost rp = RedditDAL.GetPost(0); return(View(rp)); }