public List <Programme> ListOfJsonProgram(string date, string channel) { JsonProgram jp = new JsonProgram(); jp = jsData.GetJsonChannel(date, channel); List <Programme> programList = new List <Programme>(); programList = jp.jsontv.programme.ToList(); ProgramList = programList.AsQueryable(); programList = ConvertListToString(programList); programList = SetStartTime(programList); return(programList); }
public JsonProgram GetJsonChannel(string date, string channel) { if (channel == null || date == null) { return(null); } else { string url = "http://json.xmltv.se/" + channel + ".se_" + date + ".js.gz"; var json = new WebClient().DownloadString(url); JsonProgram jp = JsonConvert.DeserializeObject <JsonProgram>(json); return(jp); } }