Skip to content
Snippets Groups Projects
Commit 0e761236 authored by Dan Michael O. Heggø's avatar Dan Michael O. Heggø
Browse files

Merge branch 'big_ask'

parents 9183e07c 2bb79128
No related branches found
No related tags found
No related merge requests found
......@@ -908,9 +908,19 @@ class Site(object):
Ask a query against Semantic MediaWiki.
API doc: https://semantic-mediawiki.org/wiki/Ask_API
Returns:
Generator for retrieving all search results
"""
kwargs = {}
if title is None:
kwargs['title'] = title
result = self.raw_api('ask', query=query, **kwargs)
return result['query']['results']
offset = 0
while offset is not None:
results = self.raw_api('ask', query='{query}|offset={offset}'.format(
query=query, offset=offset), **kwargs)
offset = results.get('query-continue-offset')
for result in results['query']['results']:
yield result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment