Skip to content

Instantly share code, notes, and snippets.



Created Oct 5, 2013
What would you like to do?
fetches all images from and makes a pdf from them
#!/usr/bin/env python
from pyquery import PyQuery as pq
import requests
bigs = []
for y in (2012,2013):
for m in range(1,13):
doc = pq(requests.get('' % (y,m)).content)
imgs = doc.find('div.has_imageurl')
bigs += map(lambda x: pq(x).attr('data-imageurl').replace('_500.','_1280.'), imgs)
except Exception as e:
print e
fh = open('links','w')
print """
mkdir img
cd img
cat ../links | uniq | xargs -P 10 -r -n 1 wget -nv
convert * do_$(date +"%d-%m-%y").pdf
cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.