Beispiel #1
0
        public IActionResult RedditPostData()
        {
            RedditDAL  dl = new RedditDAL();
            RedditPost p  = dl.GetRedditPost();

            return(View(p));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            string     text = RedditDAL.GetData();
            RedditPost rp   = new RedditPost(text, 0);

            return(View(rp));
        }
Beispiel #3
0
        public IActionResult Index()
        {
            RedditDAL dl = new RedditDAL();

            string Json = dl.CallAPI();

            ViewBag.data = Json;

            return(View());
        }
Beispiel #4
0
        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));
        }
Beispiel #5
0
        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));
        }