Created
April 13, 2021 10:41
-
-
Save C00kiie/c25feba9eda940aeaf90e16f4e8100e3 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
#!/usr/bin/env python3 | |
import requests | |
pages_max_number = 10 | |
api_url = 'https://jsonplaceholder.typicode.com/todos/{}' | |
f = open('/tmp/results.json', 'w') | |
results = [] | |
for i in range(0,pages_max_number+1): | |
results.append(requests.get(api_url.format(i)).text) | |
fancy_json = ',\n'.join(results) | |
f.write(fancy_json) | |
f.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment