This is an example that demonstrates use of the mediacloud API. This specific example compares the number of stories that mentioned 'Trump' in September 2016 with the number that mentioned 'Clinton' in the same period.
A version of Python 2.7 or greater must be installed.
python election_count.pyThe default value of variable 'key' must be replaced with the actual key value of the mediacloud user.
The previous code is streamlined by adding logging in the main code and a unit test to check proper operation.
The key variable in the test.py script must be edited to a valid value to ensure proper testing.