Skip to content

Commit

Permalink
Workaround for service alerts not fetching in Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkiGibson committed Nov 4, 2018
1 parent 9f94f0b commit f3e102e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CorvallisBus.Core/WebClients/ServiceAlertsClient.cs
Expand Up @@ -14,14 +14,19 @@ public static class ServiceAlertsClient
static readonly HttpClient httpClient = new HttpClient();
public static async Task<List<ServiceAlert>> GetServiceAlerts()
{
#if false
var responseStream = await httpClient.GetStreamAsync(FEED_URL);
var htmlDocument = new HtmlDocument();
htmlDocument.Load(responseStream);

var alerts = htmlDocument.DocumentNode.SelectNodes("//tbody/tr")
.Select(row => ParseRow(row))
.ToList();
return alerts;
#endif
return await Task.FromResult(new List<ServiceAlert>()
{
new ServiceAlert("Tap to view service alerts", "2018-11-4T00:00:00-07:00", "https://www.corvallisoregon.gov/news?field_microsite_tid=581")
});
}

private static ServiceAlert ParseRow(HtmlNode row)
Expand Down

0 comments on commit f3e102e

Please sign in to comment.