internal async Task <HtmlDocument> GetBadgePage(byte page) { if (page == 0) { return(null); } if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { return(null); } string request = SteamCommunityURL + "/my/badges?p=" + page; HtmlDocument htmlDocument = null; for (byte i = 0; (i < WebBrowser.MaxRetries) && (htmlDocument == null); i++) { htmlDocument = await WebBrowser.UrlGetToHtmlDocument(request).ConfigureAwait(false); } if (htmlDocument != null) { return(htmlDocument); } Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName); return(null); }
internal async Task <HtmlDocument> GetGameCardsPage(ulong appID) { if (appID == 0) { return(null); } if (!await RefreshSessionIfNeeded().ConfigureAwait(false)) { return(null); } HtmlDocument htmlDocument = null; for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) { htmlDocument = await WebBrowser.UrlGetToHtmlDocument(SteamCommunityURL + "/my/gamecards/" + appID + "?l=english", Cookie).ConfigureAwait(false); } if (htmlDocument == null) { Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName); return(null); } return(htmlDocument); }
internal async Task <bool?> IsLoggedIn() { HtmlDocument htmlDocument = null; for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) { htmlDocument = await WebBrowser.UrlGetToHtmlDocument(SteamCommunityURL + "/my/profile", Cookie).ConfigureAwait(false); } if (htmlDocument == null) { Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName); return(null); } HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//span[@id='account_pulldown']"); return(htmlNode != null); }
internal async Task <HtmlDocument> GetBadgePage(byte page) { if (page == 0 || SteamID == 0) { return(null); } HtmlDocument htmlDocument = null; for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) { htmlDocument = await WebBrowser.UrlGetToHtmlDocument(SteamCommunityURL + "/profiles/" + SteamID + "/badges?l=english&p=" + page, Cookie).ConfigureAwait(false); } if (htmlDocument == null) { Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName); return(null); } return(htmlDocument); }
internal async Task <HtmlDocument> GetGameCardsPage(ulong appID) { if (appID == 0 || SteamID == 0) { return(null); } HtmlDocument htmlDocument = null; for (byte i = 0; i < WebBrowser.MaxRetries && htmlDocument == null; i++) { htmlDocument = await WebBrowser.UrlGetToHtmlDocument("https://steamcommunity.com/profiles/" + SteamID + "/gamecards/" + appID + "?l=english", Cookie).ConfigureAwait(false); } if (htmlDocument == null) { Logging.LogGenericWTF("Request failed even after " + WebBrowser.MaxRetries + " tries", Bot.BotName); return(null); } return(htmlDocument); }