Skip to content

Instantly share code, notes, and snippets.

View wsricardo's full-sized avatar
🏠
Working from home in Rural City.

Wandeson Ricardo wsricardo

🏠
Working from home in Rural City.
View GitHub Profile
@ramalho
ramalho / norvigs-lispy-pybr.ipynb
Last active July 26, 2023 02:17
O lis.py de Norvig
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import urllib.request
import json
api_key = '7ba14b76dcea0086a03f8eca5a3a801f:1:74295566'
category = 'editorial'
for i in range(5):
url = "http://api.nytimes.com/svc/search/v2/articlesearch.json?" \
"q={0}&api-key={1}&page={2}".format(category, api_key, i)
h = urllib.request.urlopen(url)
result = json.loads(h.read().decode('utf-8'))