private Aweme BuildAllAwemes() { try { client.DefaultRequestHeaders.Add("User-Agent", Config.UserAgent2); HttpResponseMessage response = client.GetAsync(Config.HotEnergyUrl).Result; response.EnsureSuccessStatusCode(); string responseBody = response.Content.ReadAsStringAsync().Result; Aweme aweme = Aweme.FromJson(responseBody); return(aweme); } catch (HttpRequestException e) { Console.WriteLine("\nException Caught!"); Console.WriteLine("Message :{0} ", e.Message); } return(null); }
public HomePage() { this.InitializeComponent(); Awemes = BuildAllAwemes(); }