Advanced – Scripting a Daily Wallpaper

If you’re anything like me, you get bored of your desktop wallpaper easily.  Sure, you could have your wallpaper rotate at a regular interval but for those of you who know me, I don’t like easy solutions. In this article, I’m going to show you how to change up your wallpaper the “hard way”
What?
I imagine that this is a question that has magically popped into your head right about now. Why do this the hard way? The answer to this is rather simple: by doing things the hard way, you learn about OS X, its innards and a little scripting along the way. There’s also a particular satisfaction that comes with devising your own solution that you don’t quite get by checking a box in System Preferences.
This is unsatisfying...

This is unsatisfying…

How?
Now, there’s the right question!

For this exercise, we need a few things. First, we need a picture source. I admit that I have an uncontrollable fascination with space. You could even say that my interest is ever expanding (I’m sorry, that was a bad joke). So, we’re going to use NASA’s daily picture RSS feed as the source of our pictures. Second, we need to figure out how to get that RSS feed, parse it (read it), find the current picture of the day, download it and set it as our wallpaper. For that, we turn to Python. Finally, we need to do this daily and for this, we turn to the old but venerable cron scheduler (a tool that executes things on a regular schedule). Let’s jump in.

Step 1. Our Source.