public async Task <SAclopediaEntry> GetEntryAsync(int id) { if (!_webManager.IsAuthenticated) { throw new Exception("User must be authenticated before using this method."); } var result = await _webManager.GetDataAsync(EndPoints.SAclopediaBase + $"?act=3&topicid={id}"); var document = await _webManager.Parser.ParseAsync(result.ResultHtml); return(SAclopediaHandler.ParseEntry(document, id)); }
public async Task <List <SAclopediaCategory> > GetCategoryListAsync() { if (!_webManager.IsAuthenticated) { throw new Exception("User must be authenticated before using this method."); } var result = await _webManager.GetDataAsync(EndPoints.SAclopediaBase); var document = await _webManager.Parser.ParseAsync(result.ResultHtml); return(SAclopediaHandler.ParseCategoryList(document)); }
public async Task <SAclopediaEntry> GetEntryAsync(int id, int act = 3, CancellationToken token = default) { if (!this.webManager.IsAuthenticated) { throw new UserAuthenticationException(Awful.Core.Resources.ExceptionMessages.UserAuthenticationError); } var result = await this.webManager.GetDataAsync(EndPoints.SAclopediaBase + $"?act={act}& topicid={id}", token).ConfigureAwait(false); var document = await this.webManager.Parser.ParseDocumentAsync(result.ResultHtml, token).ConfigureAwait(false); return(SAclopediaHandler.ParseEntry(document, id)); }
public async Task <List <SAclopediaCategory> > GetCategoryListAsync(CancellationToken token = default) { if (!this.webManager.IsAuthenticated) { throw new UserAuthenticationException(Awful.Core.Resources.ExceptionMessages.UserAuthenticationError); } var result = await this.webManager.GetDataAsync(EndPoints.SAclopediaBase, token).ConfigureAwait(false); var document = await this.webManager.Parser.ParseDocumentAsync(result.ResultHtml, token).ConfigureAwait(false); return(SAclopediaHandler.ParseCategoryList(document)); }