Desktop pictures from Flickr, using Magpie and OS X

A script for use with Magpie RSS parser, running locally. Set the username for the download directory (you might have to create the directory first, too), then add RSS feed URLs as you wish (they're at the bottom of most Flickr pages).

Add something like: 15 15 * * * php /Library/WebServer/Documents/magpie/flickr.php to your crontab, and it will run once a day, fetching the RSS feeds and downloading all the new pictures to a folder, which you can then set as your Desktop Pictures folder. Set the picture to change every 15 minutes, and make sure it's centred not stretched.

define('MAGPIE_DIR', '/Library/WebServer/Documents/magpie/');
$feeds = array(
foreach ($feeds as $url) {
    $rss = fetch_rss($url);
    $items = $rss->items;
    foreach ($items as $item) {
        $description = $item['description'];
        if (preg_match("/\/photos\/(\w*?)_m.jpg/", $description, $matches)){
            $img_url = "$matches[1]_o.jpg";
            $filename = "/Users/YOUR_USERNAME/Pictures/flickr/$matches[1].jpg";
            if (file_exists($filename) == 0){
                system ( "wget $img_url --quiet -O $filename" );