Skip to content

Commit

Permalink
Merge pull request #437 from oughtinc/metaculus-api-change
Browse files Browse the repository at this point in the history
Metaculus API call fix
  • Loading branch information
uvafan committed Mar 15, 2021
2 parents 49439d9 + 5dc8c16 commit 02fb1fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ergo/platforms/metaculus/metaculus.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ def get_questions_for_pages(
return results

r = self.s.get(
f"{self.api_url}/questions/?{query_string}&page={current_page}"
f"{self.api_url}/questions/?{query_string}&limit=20&offset={20*current_page}"
)

if r.json() == {"detail": "Invalid page."}:
if len(r.json()["results"]) == 0:
return results

r.raise_for_status()
Expand Down

0 comments on commit 02fb1fd

Please sign in to comment.