You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
381 B
21 lines
381 B
6 months ago
|
import requests
|
||
|
from pprint import pprint
|
||
|
import sys
|
||
|
import csv
|
||
|
|
||
|
api_url = "http://learncodethehardway.com/api/course"
|
||
|
|
||
|
# list all courses
|
||
|
r = requests.get(api_url)
|
||
|
data = r.json()
|
||
|
pprint(data)
|
||
|
|
||
|
# get one course, full=true includes all modules
|
||
|
r = requests.get(api_url, params={
|
||
|
"course_id": 1, "full": "true" })
|
||
|
|
||
|
data = r.json()
|
||
|
pprint(data)
|
||
|
|
||
|
# remember with? use it with csv
|