public async Task <string> GetUsersByNameAsync(string name, int page) { var nameParts = string.Join("+", name.Split(" ")); var link = "https://github.com/search?q=" + nameParts + "&type=users"; var html = _searchPageResultParser.GetHtml(link + "&p=" + page).Split(" ").ToList(); var totalPagination = _searchPageResultParser.GetTotalPages(html); var usernames = _searchPageResultParser.GetUsernames(html); var users = await _gitHubRequestHandler.GetUserDataAsync(usernames); var searchResult = new SearchResultModel() { Users = users, TotalPageNumbers = totalPagination, CurrentPageNumber = page }; return(JsonConvert.SerializeObject(searchResult)); }
public async Task <List <UserModel> > GetUsersAsync(List <string> usernames) { return(await _gitHubRequestHandler.GetUserDataAsync(usernames)); }