コード例 #1
0
        public async Task<List<LeagueTableItem>> ScrapeBoldLeagueTable(string webAddress, bool useProperNames)
        {
            try
            {
                //string responseBody = await client.GetStringAsync(@"http:\\" + webAddress);
                var response = await client.GetByteArrayAsync(@"http:\\" + webAddress);
                Encoding enc = new CustomEncoder();
                string responseBody = enc.GetString(response, 0, response.Length - 1);

                List<LeagueTableItem> filteredResult = FilterLeagueTableItems(responseBody, "OB", useProperNames);

                return filteredResult;
            }
            catch (HttpRequestException e)
            {
                Debug.WriteLine("ScrapeBoldLeagueTable");
                return null;
            }
        }
コード例 #2
0
        public async Task<List<MatchItem>> ScrapeBoldSuperligaMatchSchedule(string webAddress, bool useProperNames)
        {
            try
            {
                var response = await client.GetByteArrayAsync(@"http:\\" + webAddress);
                Encoding enc = new CustomEncoder();
                string responseBody = enc.GetString(response, 0, response.Length - 1);
                List<MatchItem> filteredResult = FilterMatchItemsSuperliga(responseBody, 0, "OB", useProperNames);

                return filteredResult;
            }
            catch (HttpRequestException e)
            {
                Debug.WriteLine("ScrapeBoldSuperligaMatchSchedule: " + e);
                return null;
            }
        }