Skip to content
Explore 3,500 Facebook ads reported to have been bought by the Russian Internet Research Agency
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugins Fixed incorrect comments Aug 7, 2018
static New version ready to ship Aug 6, 2018
.gitignore
Dockerfile
README.md
build_metadata.py Converted metadata to YAML for easier editing of HTML and SQL Aug 6, 2018
fetch_and_build_russian_ads.py Update for new sqlite-utils version Feb 24, 2019
russian-ads-metadata.yaml

README.md

Converting irads JSON to Datasette

The House Intelligence Committee released 3,517 Facebook ads that were reported to have been bought by the Russian Internet Research Agency as a set of redacted PDF files.

Companion blog post: Analyzing US Election Russian Facebook Ads

Ed Summers wrote a parser that converts those PDFs into a JSON file: https://github.com/edsu/irads

The script in this repository downloads that JSON file and converts it into a SQLite database for use with Datasette. Use it like this:

pip3 install sqlite-utils
python3 fetch_and_build_russian_ads.py \
    https://raw.githubusercontent.com/edsu/irads/master/site/index.json \
    russian-ads.db

This will produce a SQLite database called ads.db. You can then explore it locally with Datasette like so:

pip3 install datasette
datasette ads.db

To see the full customized interface you will need to install a custom branch of Datasette plus a custom Datasette plugin. See the Dockerfile, or do this:

pip3 install https://github.com/simonw/datasette/archive/filter-plugin-hook.zip
pip3 install datasette-json-html pyyaml
python3 build_metadata.py
datasette russian-ads.db \
  -m russian-ads-metadata.json \
  --config default_page_size:50 --config sql_time_limit_ms:3000 \
  --config num_sql_threads:10 --config facet_time_limit_ms:3000 \
  --config allow_sql:off --config force_https_urls:1 \
  --plugins-dir=plugins --static static:static
You can’t perform that action at this time.