- Python script to download all xkcds
- 20 Nov 2010 06:01:10 pm
- Last edited by TC01 on 06 Feb 2011 12:35:56 pm; edited 2 times in total
Well, actually, this is a Python library for accessing xkcd.
It does contain five scripts- one of which does download all xkcds onto your computer. (I haven't actually downloaded all ~800 yet though). There are two others, for opening up random/last xkcds in your web browser, and two others for downloading the random/latest xkcd to your computer.
Plus, you can use the functions available in the library for doing other things.
You need Python 2.x (2.7 is the latest version) to install: you can get it here.
As of version 1.1, you no longer need the feedparser module. I've modified it to use xkcd's JSON interface, which is good for two reasons: the RSS feed sometimes has things in it that aren't comic) which break the old implemention, and secondly: it removes the only third-party dependency.
Download from here. The zip includes seven files (minus the readme, which has all this text):
-dowallxkcd.py: script to download all xkcds
-dowlastxkcd.py: script to download latest xkcd
-dowrandxkcd.py: script to download random xkcd
-lastxkcd.py: script to open a random xkcd in browser
-randxkcd.py: script to open the latest xkcd in browser
-xkcd.py: the library itself
-xkcd-1.0.zip: a zipped Python package - if you know how to install Python packages just install this
To install manually on Windows, you'd put xkcd.py in C:\Python27\lib\site-packages (wherever Python is installed, then \lib\site-packages). The scripts can go anywhere.
To install manually on Linux... it goes to the same lib/site-packages folder, but I'm not sure where this is- either /lib/python/ or /usr/lib/python, probably.
It does contain five scripts- one of which does download all xkcds onto your computer. (I haven't actually downloaded all ~800 yet though). There are two others, for opening up random/last xkcds in your web browser, and two others for downloading the random/latest xkcd to your computer.
Plus, you can use the functions available in the library for doing other things.
You need Python 2.x (2.7 is the latest version) to install: you can get it here.
As of version 1.1, you no longer need the feedparser module. I've modified it to use xkcd's JSON interface, which is good for two reasons: the RSS feed sometimes has things in it that aren't comic) which break the old implemention, and secondly: it removes the only third-party dependency.
Download from here. The zip includes seven files (minus the readme, which has all this text):
-dowallxkcd.py: script to download all xkcds
-dowlastxkcd.py: script to download latest xkcd
-dowrandxkcd.py: script to download random xkcd
-lastxkcd.py: script to open a random xkcd in browser
-randxkcd.py: script to open the latest xkcd in browser
-xkcd.py: the library itself
-xkcd-1.0.zip: a zipped Python package - if you know how to install Python packages just install this
To install manually on Windows, you'd put xkcd.py in C:\Python27\lib\site-packages (wherever Python is installed, then \lib\site-packages). The scripts can go anywhere.
To install manually on Linux... it goes to the same lib/site-packages folder, but I'm not sure where this is- either /lib/python/ or /usr/lib/python, probably.