Compare commits
No commits in common. "a9f1838fd68d9019f309254f8e696853846b9e1a" and "c77168b393b3027934354c113124d91293d5117f" have entirely different histories.
a9f1838fd6
...
c77168b393
3 changed files with 229 additions and 250 deletions
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
|
@ -58,12 +57,6 @@ public class RouteScraper {
|
||||||
httpClient = new HttpClient(httpClientHandler) {
|
httpClient = new HttpClient(httpClientHandler) {
|
||||||
BaseAddress = new Uri(BaseUrl),
|
BaseAddress = new Uri(BaseUrl),
|
||||||
DefaultRequestVersion = new Version(2, 0),
|
DefaultRequestVersion = new Version(2, 0),
|
||||||
DefaultRequestHeaders = {
|
|
||||||
UserAgent = {
|
|
||||||
new ProductInfoHeaderValue("new-infofer-scraper", "0.0.1"),
|
|
||||||
new ProductInfoHeaderValue("(developed by DC Dev as a hobby, get in touch at webmaster<at>dcdev.ro for any issues)"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
|
@ -52,12 +51,6 @@ namespace InfoferScraper.Scrapers {
|
||||||
httpClient = new HttpClient(httpClientHandler) {
|
httpClient = new HttpClient(httpClientHandler) {
|
||||||
BaseAddress = new Uri(BaseUrl),
|
BaseAddress = new Uri(BaseUrl),
|
||||||
DefaultRequestVersion = new Version(2, 0),
|
DefaultRequestVersion = new Version(2, 0),
|
||||||
DefaultRequestHeaders = {
|
|
||||||
UserAgent = {
|
|
||||||
new ProductInfoHeaderValue("new-infofer-scraper", "0.0.1"),
|
|
||||||
new ProductInfoHeaderValue("(developed by DC Dev as a hobby, get in touch at webmaster<at>dcdev.ro for any issues)"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Net.Http.Headers;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp;
|
using AngleSharp;
|
||||||
|
@ -26,7 +25,7 @@ namespace InfoferScraper.Scrapers {
|
||||||
|
|
||||||
private static readonly Regex SlRegex =
|
private static readonly Regex SlRegex =
|
||||||
new(
|
new(
|
||||||
@"^(?:Fără|([0-9]+)\smin)\s(întârziere|mai\sdevreme)\sla\s(trecerea\sfără\soprire\sprin|sosirea\sîn|plecarea\sdin)\s(.+)(?:\s\(Raportat\sla\s([0-9]+):([0-9]+)\))?\.");
|
@"^(?:Fără|([0-9]+)\smin)\s(întârziere|mai\sdevreme)\sla\s(trecerea\sfără\soprire\sprin|sosirea\sîn|plecarea\sdin)\s(.+)\.$");
|
||||||
|
|
||||||
private static readonly Dictionary<char, StatusKind> SlStateMap = new() {
|
private static readonly Dictionary<char, StatusKind> SlStateMap = new() {
|
||||||
{ 't', StatusKind.Passing },
|
{ 't', StatusKind.Passing },
|
||||||
|
@ -70,12 +69,6 @@ namespace InfoferScraper.Scrapers {
|
||||||
httpClient = new HttpClient(httpClientHandler) {
|
httpClient = new HttpClient(httpClientHandler) {
|
||||||
BaseAddress = new Uri(BaseUrl),
|
BaseAddress = new Uri(BaseUrl),
|
||||||
DefaultRequestVersion = new Version(2, 0),
|
DefaultRequestVersion = new Version(2, 0),
|
||||||
DefaultRequestHeaders = {
|
|
||||||
UserAgent = {
|
|
||||||
new ProductInfoHeaderValue("new-infofer-scraper", "0.0.1"),
|
|
||||||
new ProductInfoHeaderValue("(developed by DC Dev as a hobby, get in touch at webmaster<at>dcdev.ro for any issues)"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue