Last active
June 21, 2018 03:35
-
-
Save adinbied/13635e5afd7a76cec29e467fb145ba72 to your computer and use it in GitHub Desktop.
This file contains 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 sys | |
import requests | |
for id in sys.argv[1:]: | |
baseurl = 'https://api.quizlet.com/2.0/sets/' | |
afterurl = '?client_id=<apikey>' | |
fullurl = baseurl + str(id) + afterurl | |
headers = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36'} | |
r = requests.get(fullurl, headers=headers) | |
if r.status_code == 200: | |
open(str(id) + '.txt', 'wb').write(r.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment