Skip to content

Instantly share code, notes, and snippets.

@ricardojob
Created October 14, 2016 15:10
Show Gist options
  • Save ricardojob/f91751215fc6425b89a6e0a76b378716 to your computer and use it in GitHub Desktop.
Save ricardojob/f91751215fc6425b89a6e0a76b378716 to your computer and use it in GitHub Desktop.
#ricardojob
import re
ext = ".epub"
listOfBooks={
'http://www.oreilly.com/programming/free/hadoop-with-python.csp',
'http://www.oreilly.com/programming/free/microservices-for-java-developers.csp'
}
for key in listOfBooks:
retorno = re.search(r"free/(.*?).csp", key).group(0)
book = retorno.split('free/')[1].strip('.csp')
print 'http://www.oreilly.com/programming/free/files/'+book+ext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment