public static BestSellersListNames GetNytBestSellersListNames() { BestSellersListNames bs = null; string res = String.Empty; using (WebParser wp = new WebParser(cStrNYTBooksBaseUrl)) { res = wp.Request(cStrNYTBooksResource, Method.GET, cStrNYTApiKeyStr, cStrNYTApiKeyVal); bs = wp.DeserializeJson <BestSellersListNames>(res); } return(bs); }
public static BestSellersListNames GetNYTBestSellersListNames() { BestSellersListNames bs = null; try { using (WebParser wp = new WebParser(cStrNYTBooksBaseUrl)) { string res = wp.Request(cStrNYTBooksResource, Method.GET, cStrNYTApiKeyStr, cStrNYTApiKeyVal); bs = wp.DeserializeJson <BestSellersListNames>(res); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(bs); }
public static void DisplayNYTBestSellersListNames() { try { BestSellersListNames b = GetNYTBestSellersListNames(); if (b != null && b.results.Length > 0) { foreach (BestSellerListNamesItems i in b.results) { Console.WriteLine("Name: " + i.display_name); Console.WriteLine("Oldest Published Date: " + i.oldest_published_date.ToString()); Console.WriteLine("Newest Published Date: " + i.newest_published_date.ToString()); Console.WriteLine(Environment.NewLine); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }