Skip to content

Instantly share code, notes, and snippets.

@cb372
Created August 17, 2016 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cb372/936caf91e69f1aed9513d2179418b4cd to your computer and use it in GitHub Desktop.
Save cb372/936caf91e69f1aed9513d2179418b4cd to your computer and use it in GitHub Desktop.
Descriptions of Donald Trump as "reality TV star" in Guardian articles over time
$ curl 'https://content.guardianapis.com/search?tag=us-news/donaldtrump&q=%22reality%20tv%20star%22&page-size=200&from-date=2015-06-01&api-key=<api-key>' | \
jq -r '.response.results[].webPublicationDate' | \
cut -c1-7 | \
sort | \
uniq -c | \
gnuplot -e 'set terminal png; set output "test.png"; set xdata time; set timefmt "%Y-%m"; set xrange ["2015-06":"2016-08"]; set format x "%m/%Y"; plot "<cat" using 2:1 with lines title "Reality TV star"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment