Skip to content

Instantly share code, notes, and snippets.

View jeanpaulrsoucy's full-sized avatar

Jean-Paul R. Soucy jeanpaulrsoucy

View GitHub Profile
@jeanpaulrsoucy
jeanpaulrsoucy / git_export_all_file_versions.sh
Created November 24, 2021 21:34
Extract all versions of a file from the Git repository history.
#!/bin/sh
# based on script provided by Dmitry Shevkoplyas at http://stackoverflow.com/questions/12850030/git-getting-all-previous-version-of-a-specific-file-folder
set -e
if ! git rev-parse --show-toplevel >/dev/null 2>&1 ; then
echo "Error: you must run this from within a git working directory" >&2
exit 1
fi
@jeanpaulrsoucy
jeanpaulrsoucy / bc-archive-data.py
Created September 22, 2021 00:08
Download archived BC COVID-19 hospitalization and ICU data into a single spreadsheet
# Download archived BC COVID-19 hospitalization data from the Archive of Canadian COVID-19 Data
# and extract data from JSON files into a single CSV spreadsheet
# https://github.com/ccodwg/Covid19CanadaArchive
# bug: there may be a few dates with duplicate data from when the archive tool downloaded the same file twice in one day
# load modules
import os
import re
import json

Scrape COVID-19 pharmacy vaccine locations for Ontario

Jean-Paul R. Soucy (jprs.me)

Let's scrape the names, addresses and public health units of pharmacies in Ontario offering the COVID-19 vaccine from the provincial website.

# load packages
library(rvest)
library(stringr)
# Scraping and plotting Canadian COVID-19 VOC data
*Jean-Paul R. Soucy*
Let's scrape the VOC data from the [CTV News variant tracker](https://www.ctvnews.ca/health/coronavirus/tracking-variants-of-the-novel-coronavirus-in-canada-1.5296141) (maintained by journalists [Jesse Tahirali](https://twitter.com/jessetahirali) and [Stephanie Liu](https://twitter.com/_stephanieliu)) and the [Public Health Agency of Canada](https://health-infobase.canada.ca/covid-19/epidemiological-summary-covid-19-cases.html#VOC).
```{r variant-data}
# load packages
library(jsonlite)
suppressPackageStartupMessages(library(dplyr))

Scraping data from Manitoba COVID-19 school outbreaks

Jean-Paul R. Soucy

Let's scrape the 14-day school-associated case counts from the Manitoba Schools Dashboard.

We begin by loading the package we need to grab the JSON data.