Created
April 9, 2014 20:32
-
-
Save natematias/10311557 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mediacloud | |
| import json | |
| mc = mediacloud.api.MediaCloud('') | |
| # query mentions of civic hacking | |
| res = mc.sentenceList('( hacking AND civic ) OR ( hackathon AND civic)', '+publish_date:[2013-01-01T00:00:00Z TO 2014-04-19T00:00:00Z] AND +media_sets_id:1') | |
| #print "found " + res['response']['numFound'] + " sentences" | |
| story_ids = [] | |
| [story_ids.append(i) for i in [y["stories_id"] for y in res["response"]["docs"]] if not story_ids.count(i)] | |
| stories = [mc.story(i) for i in story_ids] | |
| print json.dumps(stories) |
rahulbot
commented
Apr 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment