Skip to content

Instantly share code, notes, and snippets.

@josht-jpg
Last active September 2, 2020 20:44
Show Gist options
  • Save josht-jpg/98eb2715a5ba695df73dfecd96bc0b7c to your computer and use it in GitHub Desktop.
Save josht-jpg/98eb2715a5ba695df73dfecd96bc0b7c to your computer and use it in GitHub Desktop.
Getting Notes from the Underground from Gutenberg.org
from urllib import request
def get_book(url):
response = request.urlopen(url)
return response.read().decode('utf8')
notes_from_underground_raw = get_book("http://www.gutenberg.org/files/600/600.txt")
crime_and_punishment_raw = get_book("http://www.gutenberg.org/files/2554/2554-0.txt")
the_idiot_raw = get_book("http://www.gutenberg.org/files/2638/2638-0.txt")
the_possessed_raw = get_book("http://www.gutenberg.org/files/8117/8117-0.txt")
the_brothers_karamazov_raw = get_book("http://www.gutenberg.org/files/28054/28054-0.txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment