public async Task <ItemHistoryJsonResponse> FetchItemHistoryJsonResponseAsync(ItemType itemType, int itemId, Leagues league = Leagues.Default) { var date = DateTime.Today.ToString("yyyy-MM-dd"); var leagueName = league.GetAttributeValue <PoeNinjaAttribute, string>(o => o.Name); var url = $"https://poe.ninja/api/data/itemhistory?league={leagueName}&type={itemType}&date={date}&itemId={itemId}"; return((await FetchDeserializedResponseAsync <ItemHistoryJsonResponse>(url, null)).Model); }
public static string Name(this Leagues League) { return(League.GetAttributeValue <NameAttribute, string>(o => o.Name)); }
private string Url(ItemType itemType, Leagues league) { var leagueName = league.GetAttributeValue <PoeNinjaAttribute, string>(o => o.Name); return(string.Format(itemType.GetAttributeValue <UrlFormatAttribute, string>(o => o.UrlFormat), leagueName)); }
public static string DataDirectory(this Leagues League) { return(League.GetAttributeValue <DataDirectoryAttribute, string>(o => o.Directory)); }