5 years ago
COVID-19
Hey all,
I built out a datasource to monitor the COVID-19 cases and deaths per state. An API key from Finnhub.io is required to run this DataSource. The API key must be saved as a custom prop...
1 minute ago, Stuart Weenig said:Just had a realization. If you aren't interested in all states, you could apply a discovery filter to only include those states where your company has offices.
That is a good point. I found a little bug too. the API is returning "Colorado " with a space at the end which was returning NaN in the script. I did a ghetto little workaround.
Its not pretty but it works. lol
if($wildvalue -eq "Colorado"){
$Case = ($Data | Where-Object State -eq "Colorado ").case
$Death = ($Data | Where-Object State -eq "Colorado ").death
Write-Host Cases=$Case
Write-Host Deaths=$Death
}else{
$Data = $Return | Select-Object -ExpandProperty Content | ConvertFrom-Json
$Case = ($Data | Where-Object State -eq $wildvalue).case
$Death = ($Data | Where-Object State -eq $wildvalue).death
Write-Host Cases=$Case
Write-Host Deaths=$Death
}