Skip to content

A simple python script to keep your digital copies of the MagPi up to date. Runs on Raspbian (and any other variation of Debian and Ubuntu)

License

Notifications You must be signed in to change notification settings

b4ux1t3/magpi-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple Python script which should run well on any Debian-based OS, but was designed on a Raspberry Pi.

You can change mirrors by changing the src and suf to whatever URL you want, but only if they use non-formatted issue numbers. (e.g. http://www.example.com/the-magpi-issue-1.pdf as opposed to /the-magpi-issue-01.pdf)

I would recommend setting it up to a cron job that runs monthly.

I currently have mine set up to run every day of the second week of every month. To do that, just type sudo crontab -e, then add these lines to the file:

0 12 7 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 8 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 9 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 10 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 11 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 12 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py
0 12 13 * * python <PATH TO YOUR MAGPI>/magpi/magpidl.py

If that is wrong, someone please let me know!

TODO:

  • The program is not currently pure Python. I had trouble getting urllib2 to work right. Specifically, I could not get the response handler (line 52) to write to newIssue (line 63). I was getting an error. You can try it for yourself by uncommenting lines 62-64 and running it.

About

A simple python script to keep your digital copies of the MagPi up to date. Runs on Raspbian (and any other variation of Debian and Ubuntu)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages