public List <WFAlert> GetAlerts() { try { var alerts = WebHelper.DownloadJson <List <WFAlert> >($"https://api.warframestat.us/{platform}/alerts"); foreach (var alert in alerts) { translator.TranslateAlert(alert); alert.Activation = GetRealTime(alert.Activation); alert.Expiry = GetRealTime(alert.Expiry); } return(alerts); } catch (HttpRequestException) { // 啥也不做 } catch (WebException) { // 啥也不做 } catch (Exception e) { Messenger.SendDebugInfo($"警报获取报错: \r\n" + $"{e}"); } return(new List <WFAlert>()); }
private static WFApi GetThirdPartyTranslateApi() { var alerts = WebHelper.DownloadJson <Alert[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Alert.json"); var dicts = WebHelper.DownloadJson <Dict[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Dict.json"); var invasions = WebHelper.DownloadJson <Invasion[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Invasion.json"); var sales = WebHelper.DownloadJson <Sale[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Sale.json"); var riven = WebHelper.DownloadJson <Riven[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Riven.json"); var relic = WebHelper.DownloadJson <Relic[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Relic.json"); var modifier = WebHelper.DownloadJson <Modifier[]>( "https://raw.githubusercontent.com/TheRealKamisama/WFA_Lexicon/master/WF_Modifier.json"); var translateApi = new WFApi { Alert = alerts, Dict = dicts, Invasion = invasions, Relic = relic, Riven = riven, Sale = sales, Modifier = modifier }; return(translateApi); }
public VallisCycle GetVallisCycle() { var cycle = WebHelper.DownloadJson <VallisCycle>("https://api.warframestat.us/pc/vallisCycle"); cycle.expiry = GetRealTime(cycle.expiry); return(cycle); }
public List <Kuva> GetKuvaMissions() { var kuvas = WebHelper.DownloadJson <List <Kuva> >("https://api.warframestat.us/pc/kuva"); translator.TranslateKuvaMission(kuvas); return(kuvas); }
public CetusCycle GetCetusCycle() { var cycle = WebHelper.DownloadJson <CetusCycle>($"https://api.warframestat.us/{platform}/cetusCycle"); cycle.Expiry = GetRealTime(cycle.Expiry); return(cycle); }
public EarthCycle GetEarthCycle() { var cycle = WebHelper.DownloadJson <EarthCycle>($"https://api.warframestat.us/{platform}/earthCycle"); cycle.expiry = GetRealTime(cycle.expiry); return(cycle); }
public Arbitration GetArbitrationMission() { var ar = WebHelper.DownloadJson <Arbitration>("https://api.warframestat.us/pc/arbitration"); translator.TranslateArbitrationMission(ar); return(ar); }
public WFNightWave GetNightWave() { var wave = WebHelper.DownloadJson <WFNightWave>($"https://api.warframestat.us/{platform}/nightwave"); translator.TranslateNightWave(wave); return(wave); }
public List <PersistentEnemie> GetPersistentEnemies() { var enemies = WebHelper.DownloadJson <List <PersistentEnemie> >("https://api.warframestat.us/pc/persistentEnemies"); translator.TranslatePersistentEnemies(enemies); return(enemies); }
public List <SyndicateMission> GetSyndicateMissions() { var missions = WebHelper.DownloadJson <List <SyndicateMission> >($"https://api.warframestat.us/{platform}/syndicateMissions"); translator.TranslateSyndicateMission(missions); return(missions); }
public List <Fissure> GetFissures() { var fissures = WebHelper.DownloadJson <List <Fissure> >($"https://api.warframestat.us/{platform}/fissures"); translator.TranslateFissures(fissures); return(fissures); }
private static Dict[] GetDictFromWFA() { var dicts = WebHelper.DownloadJson <Dict[]>( "https://raw.githubusercontent.com/Richasy/WFA_Lexicon/master/WF_Dict.json"); return(dicts); }
public Sortie GetSortie() { var sortie = WebHelper.DownloadJson <Sortie>($"https://api.warframestat.us/{platform}/sortie"); translator.TranslateSortie(sortie); return(sortie); }
public List <RivenData> GetRivenDatas() { var info = WebHelper.DownloadJson <List <RivenData> >( "http://n9e5v4d8.ssl.hwcdn.net/repos/weeklyRivensPC.json"); info.ForEach(d => d.compatibility = d.compatibility.IsNullOrEmpty() ? "" : translator.TranslateWeapon(d.compatibility.Replace("<ARCHWING> ", "").Format())); return(info); }
public WMInfoEx GetWMINfoEx(string searchword) { var header = new WebHeaderCollection(); header.Add("Authorization", $"Bearer {Config.Instance.AcessToken}"); var info = WebHelper.DownloadJson <WMInfoEx>($"https://api.richasy.cn/wfa/basic/pc/wm/{searchword}", header); return(info); }
public VoidTrader GetVoidTrader() { var trader = WebHelper.DownloadJson <VoidTrader>($"https://api.warframestat.us/{platform}/voidTrader"); trader.activation = GetRealTime(trader.activation); trader.expiry = GetRealTime(trader.expiry); translator.TranslateVoidTrader(trader); return(trader); }
public List <RivenInfo> GetRiveninfos(string weapon) { var header = new WebHeaderCollection(); var count = 5; header.Add("Authorization", $"Bearer {Config.Instance.AcessToken}"); header.Add("Platform", "pc"); header.Add("Weapon", weapon.ToBase64()); return(WebHelper.DownloadJson <List <RivenInfo> >($"https://api.richasy.cn/wfa/rm/riven", header).Where(info => info.isSell == 1).Take(count).ToList()); }
public List <WFInvasion> GetInvasions() { var invasions = WebHelper.DownloadJson <List <WFInvasion> >($"https://api.warframestat.us/{platform}/invasions"); foreach (var invasion in invasions) { translator.TranslateInvasion(invasion); invasion.activation = GetRealTime(invasion.activation); } return(invasions); }
public List <Event> GetEvents() { var events = WebHelper.DownloadJson <List <Event> >($"https://api.warframestat.us/{platform}/events"); translator.TranslateEvents(events); foreach (var @event in events) { @event.expiry = GetRealTime(@event.expiry); } return(events); }
public WMInfo GetWMInfo(string searchword) { var header = new WebHeaderCollection(); var platform = Config.Instance.Platform.GetSymbols().First(); if (Config.Instance.Platform == Platform.NS) { platform = "switch"; } header.Add("platform", platform); var info = WebHelper.DownloadJson <WMInfo>($"https://api.warframe.market/v1/items/{searchword}/orders?include=item"); return(info); }
public List <RivenInfo> GetRiveninfos(string weapon) { var header = new WebHeaderCollection(); var count = 5; var platform = Config.Instance.Platform.GetSymbols().First(); if (Config.Instance.Platform == Platform.NS) { platform = "ns"; } header.Add("Authorization", $"Bearer {Config.Instance.AcessToken}"); header.Add("Platform", platform); header.Add("Weapon", weapon.ToBase64()); return(WebHelper.DownloadJson <List <RivenInfo> >($"https://api.richasy.cn/wfa/rm/riven", header).Where(info => info.isSell == 1).Take(count).ToList()); // 操 云之幻好蠢 为什么不能在请求里限制是买还是卖 }
public WMInfoEx GetWMINfoEx(string searchword) { var header = new WebHeaderCollection(); header.Add("Authorization", $"Bearer {Config.Instance.AcessToken}"); var platform = Config.Instance.Platform.GetSymbols().First(); if (Config.Instance.Platform == Platform.NS) { platform = "ns"; } var info = WebHelper.DownloadJson <WMInfoEx>($"https://api.richasy.cn/wfa/basic/{platform}/wm/{searchword}", header); return(info); }
private static void Download <T>(string url, Action <T> setter, string path) { var content = WebHelper.DownloadJson <T>(url); try { File.WriteAllText(path, content.ToJsonString()); } catch (Exception e) { Trace.WriteLine($"我操我上辈子是日了狗么, 缓存 {path} 无法保存. {e}", "Cache"); //哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈哈哈哈哈 --2019年3月2日22:18:27 } setter(content); finishedCount++; if (finishedCount == expectedCount && expectedCount >= 6) { Messenger.SendDebugInfo("可缓存的玩意看起来全部下载完成."); } }
public WMInfo GetWMInfo(string searchword) { var info = WebHelper.DownloadJson <WMInfo>($"https://api.warframe.market/v1/items/{searchword}/orders?include=item"); return(info); }
public Wiki GetWiki(string word) { return(WebHelper.DownloadJson <Wiki>( $"https://warframe.huijiwiki.com/api.php?action=query&format=json&formatversion=2&list=search&srsearch={word}")); }
public SentientOutposts GetSentientOutposts() { var outposts = WebHelper.DownloadJson <SentientOutposts>("https://api.warframestat.us/pc/sentientOutposts"); return(outposts); }