Análisis de los datos sobre cobertura de corrupción en España recopilados en PageOneX
HTML JavaScript R Shell CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
css
data
ds
img
js
README.md
index.html
json_to_d3_ready_script.html
preprocess-data.R
total2013-2016.json
wget.sh

README.md

colorcorrupcion

Análisis de los datos sobre cobertura de corrupción en España recopilados en PageOneX http://numeroteca.org/colorcorrupcion

How to

1. Download data from PageOneX

Execute in terminal the bash file:

./wget.sh\

If it doesn't work for you: just copy and paste the content of the script wget.sh.

2. Merge all the downloaded json files

Given colorcorrupcion-1.json and colorcorrupcion-0.json it is possible to merge them to one file basic3.json with jq (http://stedolan.github.io/jq/) and only keep the data stored in object "data":

Merge two files:

jq -s 'reduce .[] as $dot ({}; .data += $dot.data)' colorcorrupcion-1.json colorcorrupcion-0.json > colorJanFeb2015.json

(In this specific case, we are merging January and February 2013 first as February thread is partially filled with data, the other part is in January thread).

We remove then remove colorcorrupcion-1.json colorcorrupcion-0.json, as their data have been merged in colorJanFeb2015.json.

Merge all the files which name start with "color":

jq -s 'reduce .[] as $dot ({}; .data += $dot.data)' color*.json > data/total201320142015.json

Rename newspaper names with accents inside the file. Ex: "El País" to "El País".

3. Generate json files

One file per each media must be generated with the file json_to_d3_ready_script.html

Change "var media" to the name of the newspaper that applies and save the file as .json

4. Use

Navigate to index.html or / where the files are stored and enjoy the data visualization.