using System;
using System.Configuration;
using System.Net;
using Newtonsoft.Json.Linq;

namespace TwitterPractice.Models
{
    public class TwitterModels
    {
        private string requestTemplate;
        public TwitterModels()
        {
            requestTemplate = ConfigurationManager.AppSettings["TwitterRequestTemplate"];
        }
            
        public JArray GetTwitterStream(string username)
        {
            string requestUrl = String.Format(requestTemplate, username);
            WebClient req = new WebClient();
            return JArray.Parse(req.DownloadString(requestUrl));
        }
    }
}