Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Primitive scraper for NE #73

Closed
baryluk opened this issue Mar 21, 2020 · 0 comments
Closed

Primitive scraper for NE #73

baryluk opened this issue Mar 21, 2020 · 0 comments

Comments

@baryluk
Copy link
Contributor

baryluk commented Mar 21, 2020

echo NE; d=$(curl --silent "https://www.ne.ch/autorites/DFS/SCSP/medecin-cantonal/maladies-vaccinations/Pages/Coronavirus.aspx" | grep 'Nombre de cas confirmés'); echo "Scraped at $(date --iso-8601=seconds)"; echo -n "Date and time: "; echo "$d" | sed -E -e 's/^.*>Neuchâtel(&#160;)* +([^<]+)<\/span>.*$/\2/'; echo -n "Confirmed cases: "; echo "$d" | sed -E -e 's/<br>/\n/g' | grep -A 3 ">Neuchâtel" | egrep "Nombre de .* confirmés" | sed -E -e 's/^.*[^0-9]+([0-9]+) pers.*$/\1/'; echo -n "Deaths: "; echo "$d" | sed -E -e 's/<br>/\n/g' | grep -A 3 ">Neuchâtel" | egrep "Nombre.* décès" | head -1 | sed -E -e 's/^.*[^0-9]+ ([0-9]+)( pers.*|<\/strong).*$/\1/'
NE
Scraped at 2020-03-21T17:11:14+00:00
Date and time: 21.03.2020, 15h30
Confirmed cases: 177
Deaths: 2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants