
So as always, I'm open to feedback and suggestions.
BACKGROUND PHOTO DESKTOP CODE
This code has been tested under Leopard using Python 2.5, but also under Ubuntu using Python 2.4.3, and I believe it should also work under Tiger using Python 2.3, but I could very well be wrong. As you can see, the script is not that complicated, and I can very easily modify the way the photos are served to the clients. Old_hash = md5.md5(image_file.read()).hexdigest() Os.system("mv %s %s" % (old_img_filename, img_filename)) # If one does, give it the current photo filename Old_img_filename = "%s%s_%s.jpg" % (dst_dir, group, j) # Check all the saved photos and see if any of them have the same hash Img_filename = "%s%s_%s.jpg" % (dst_dir, group, i) Photo_hash = element.getElementsByTagName('hash').firstChild.data Link = element.getElementsByTagName( 'link' ).getAttribute('source') Group = element.getElementsByTagName( 'title' ).getAttribute('group') # Go through all the photos in the rss feed, in reverse order Hashes = md5.md5(image_file.read()).hexdigest()

Img_filename = "%s%s_%s.jpg" % (dst_dir,group,i) # Store the md5 hashes of all the saved photos Group = node_lst.item(0).getElementsByTagName('title').getAttribute('group') Node_lst = dom.getElementsByTagName('item') # Comment / Uncomment the following lines to use the required feedsĭst_dir = os.path.expanduser('~/Pictures/DeskFeed/') ParseFeed (rss_feeds ) if _name_ = "_main_": retrieve (link, img_filename ) except IOError: system ( "mv %s %s" % (old_img_filename, img_filename ) ) # If one does, give it the current photo filename os. Old_img_filename = "%s%s_%s.jpg" % (dst_dir, group, j ) if (hashes = photo_hash ): Img_filename = "%s%s_%s.jpg" % (dst_dir, group, i ) # Check all the saved photos and see if any of them have the same hash for j in range (i ): Hashes = "" pass # Go through all the photos in the rss feed, in reverse order Img_filename = "%s%s_%s.jpg" % (dst_dir ,group ,i ) try: getAttribute ( 'group' ) # Store the md5 hashes of all the saved photos for i in items: expanduser ( '~/Pictures/DeskFeed/' ) # Based on script found at # def parseFeed (rss ): Rss_feeds = # Comment / Uncomment the following lines to use the required feeds #ĭst_dir = os. #!/usr/bin/env python import os import md5 from urllib import URLopenerįrom xml.
BACKGROUND PHOTO DESKTOP DOWNLOAD
Then, download this script into the folder you just created, and run the following commands in the Terminal (found under Applications/Utilities/Terminal): To use this, you need to create a folder called DeskFeed inside the Pictures folder located in your Home directory (resulting path: ~/Pictures/DeskFeed, where ~/ is your home directory). The other way to use this application, is through a small Python script which I wrote.

Also in Tiger, I believe you can only use an iPhoto photo feed as a Screen Saver, not as a Desktop Background. There are three down sides to using this method: You have to open iPhoto every day to refresh the feeds manually, every time iPhoto refreshes it has to download all the photos over again, and you can only use the photos from a single feed, not multiple ones. Just subscribe to the iPhoto photo feed for either chromasia ( ) or daily dose of imagery ( ). The easiest way is through iPhoto 6 or 7. There are several ways to use these feeds. So far, the script supports the feeds of David Nightingale's Chromasia who kindly agreed to let me download web-scaled versions of his photos for use with this script and also helped me test early versions of the app, and Sam Javanrouh's daily dose of imagery.

This application takes care of keeping a database of the most recent photos linked to from the provided feeds, thus balancing the load placed on the hosting servers, and also allowing me to serve the feeds in a single standardised format. To solve these issues, I created a small application using Google's wonderful App Engine, which takes care of everything. I wanted to use the script to download the photos from Chromasia, which brings me to point number three: some feeds don't link to the large photo, but instead only include a thumbnail. Second, the script would always download all the photos linked to from the feed, thus increasing the load placed on the hosting server. If you wanted to use a different feed, you would have to change the code. Well, as it turns out you can also use that folder as a desktop background, but there are a few improvements that can be made.įirst, the script only worked with that particular feed. The idea is simple: Take a feed, parse it, and save the photos it links to as numbered images in a folder on the disk, then use that folder as a Screen Saver. I first came up with this idea after reading a post on about getting an RSS feed of images as a Screen Saver using a python script. The tips and techniques explained may be outdated. This post was originally published in 2008
