Skip to content

Instantly share code, notes, and snippets.

@caseysoftware
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save caseysoftware/d34d9e67d07bc815df8d to your computer and use it in GitHub Desktop.

Select an option

Save caseysoftware/d34d9e67d07bc815df8d to your computer and use it in GitHub Desktop.
This is used to help students find the most important parts of their class lectures. The full description is here: http://clarify.io/blog/a-study-hint-for-final-exams/
from clarify_python import clarify
clarify.set_key('my api key')
result = clarify.search(query='"on the exam"')
results = result['item_results']
items = result['_links']['items']
index = 0
for item in items:
bundle = clarify.get_bundle(item['href'])
print(bundle['name'])
search_hits = results[index]['term_results'][0]['matches'][0]['hits']
for search_hit in search_hits:
print(str(search_hit['start']) + ' -- ' + str(search_hit['end']))
++index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment