Skip to content

Instantly share code, notes, and snippets.

@conorsch
Created December 15, 2020 23:38
Show Gist options
  • Save conorsch/cf1c92781731cd4d4a7bdf01ec769c37 to your computer and use it in GitHub Desktop.
Save conorsch/cf1c92781731cd4d4a7bdf01ec769c37 to your computer and use it in GitHub Desktop.
Example API queries for US Press Freedom Tracker
$ curl -s https://pressfreedomtracker.us/all-incidents/export/ | xsv frequency -s categories | xsv select 2,3 | xsv table
value count
Physical Attack 265
Arrest / Criminal Charge 100
Other Incident 73
Subpoena / Legal Order 71
Physical Attack, Equipment Damage 54
Denial of Access 48
Chilling Statement 42
Arrest / Criminal Charge, Physical Attack 35
Border Stop 27
Equipment Damage 24
$ curl -s https://pressfreedomtracker.us/all-incidents/export/ | xsv search -s categories 'Physical Attack' | xsv select first_published_at,title | sort | head -n -1 | xsv table | tail -n 10
2020-12-09 12:36:46.674273+00:00 Daily Caller journalist beaten, detained by police while covering protests in Wisconsin
2020-12-11 20:34:52.668491+00:00 Daily Caller journalist hit, detained by police while covering Wisconsin protest
2020-12-13 11:22:23.695880+00:00 Photographer slammed to the ground, arrested by Portland police
2020-12-13 11:53:00.647451+00:00 Four journalists shoved by law enforcement officers while documenting Portland protests
2020-12-13 12:53:23.864937+00:00 Chicago journalists report assaults by police during Columbus statue protests
2020-12-13 13:03:48.106951+00:00 CBS Chicago reporter assaulted by individual while filming Columbus statue protest
2020-12-13 13:12:31.456089+00:00 Independent photojournalist threatened by man with a gun in Portland
2020-12-14 21:54:49.311511+00:00 Journalists shoved by pro-Trump demonstrators in Salem, Oregon
2020-12-14 22:04:00.516056+00:00 Independent journalist pushed, hit with munitions by police while covering Portland protest
2020-12-14 22:08:13.654423+00:00 Independent journalist hit with munitions fired by police while covering Portland protest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment