| | 1 | A bash script to fetch files from the Django website. |
| | 2 | |
| | 3 | Example usage: |
| | 4 | |
| | 5 | {{{ |
| | 6 | cd ~/mytemplates |
| | 7 | djget http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/base_community.html |
| | 8 | }}} |
| | 9 | |
| | 10 | This fetches the named file and puts it in the current directory with the basename which, in this case, is base_community.html. |
| | 11 | |
| | 12 | Here is the script: |
| | 13 | |
| | 14 | {{{ |
| | 15 | #! /bin/bash |
| | 16 | filename=$1 |
| | 17 | filebasename=`basename ${filename}` |
| | 18 | wgetfilename=${filename}?format=txt |
| | 19 | wget ${wgetfilename} |
| | 20 | if [ $? = 0 ]; then |
| | 21 | mv ${filebasename}?format=txt ${filebasename} |
| | 22 | else |
| | 23 | echo wget failed for ${filename} |
| | 24 | fi |
| | 25 | }}} |