Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for service alerts not fetching in Azure #30

Merged
merged 1 commit into from Nov 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions CorvallisBus.Core/WebClients/ServiceAlertsClient.cs
Expand Up @@ -14,6 +14,7 @@ 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);
Expand All @@ -22,6 +23,11 @@ public static async Task<List<ServiceAlert>> GetServiceAlerts()
.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