This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl https://covid19.innews.gr | gunzip > covid.html | |
cat covid.html | grep daily_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > daily_stats.json | |
cat covid.html | grep weekly_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > weekly_stats.json | |
cat covid.html | grep three_days_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > three_days_stats.json | |
cat covid.html | grep last_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > today_stats.json | |
cat covid.html | grep total_stats | cut -d "=" -f2 | sed 's/^.//;s/.$//' > total_stats.json | |
rm covid.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Content = (Invoke-WebRequest -Uri "https://covid19.innews.gr").Content | |
$daily_stats = ($content -match '(?<=daily_stats = )(.*)(?=;)') | |
$daily_stats = $Matches[0] | Out-File "daily_stats.json" | |
$weekly_stats = $content -match '(?<=weekly_stats = )(.*)(?=;)' | |
$weekly_stats = $Matches[0] | Out-File "weekly_stats.json" | |
$three_days_stats = $content -match '(?<=three_days_stats = )(.*)(?=;)' | |
$three_days_stats = $Matches[0] | Out-File "three_days_stats.json" | |
$last_stats = $content -match '(?<=last_stats = )(.*)(?=;)' | |
$last_stats = $Matches[0] | Out-File "last_stats.json" | |
$total_stats = $content -match '(?<=total_stats = )(.*)(?=;)' |