Web-Scraping Virus Count Results
Source URL: https://coronavirus-dashboard.utah.gov/
- .\ReturnCounts.ps1 Save
- .\ReturnCounts.ps1 Get
- Get-Help .\ReturnCounts.ps1 -Online
Get New Data from Source URL and then compare data with previous days Data. Get will pull new data and then display the difference so long as Get and then Save has not occured.
Note: Once the data for the day has been saved the daily difference will result in all Zeros. Since the Current Data and Previous Data will then be the same data.
Save setting will save all of the collected data variables into a file that will then be pulled each time the ReturnCounts.ps1 command file is executed.
File list the Variable and the Previous Days Data. Variables above with associated data will then be retrieved when the PS1 Script is executed
The Data above was Captured on May 17th, 2020 for Utah State / Utah Counties. This data will no longer be accurate after the 17th of May 2020
No Prams Submitted
If no prams are submitted when calling ReturnCounts.ps1 then no data will be pulled from the source URL. Data for already pulled data will then be displayed. Provided a Get has already been executed once for the day.
If no Get has been executed yet then the data for the previous day will be pulled. If no DataFile Exists then you may get an error or just no data. Not sure I have not tested that option yet.
Help file for ReturnCounts.ps1
Get-Help .\ReturnCounts.ps1 -Online
Help file Header
.SYNOPSIS Returns Current Virus Data and if Data has not been saved for the Day pulled then Previous Data and Current Data will be shown for the Virus Status Report .DESCRIPTION Get Current Virus Data and calculate Percentage towards Salt Lake County. Show the current and Previous Counts Get Will Pull Current Data Save Will Save Results to a File. Once Saved the Previous Data and Current Data will be Identical So data saved in the Difference Column will show all ZEROS No Pram will only Show Current Data Vrs Previous Data .EXAMPLE .\ReturnCounts Save .\ReturnCounts Get .\ReturnCounts .NOTES This Script will pull data variables from previously saved data if exits or it will create a new DataFile. .LINK https://www.boonewebmaster.com/powerscripts/returncounts-ps1-help/