How to use Flickr favourites as your screensaver in OS X Yosemite, Mavericks and Mountain Lion

Mountain Lion was an improvement on Lion, which I had mixed feelings about when it was released. Unfortunately, however, Apple apparently decided that RSS is a dead technology (although it seems to be creeping back into Safari), and consequently the handy RSS screensavers were removed, which means there was no simple way of creating a screensaver out of one’s Flickr favourites in Mountain Lion, and this remains the case in Mavericks and Yosemite.

Having come up with an effective solution for how to get Flickr favourites as a screensaver in Mountain Lion which also works in Mavericks and Yosemite, I thought I’d share the method for the benefit of those who are not so used to fiddling with the deeper technological aspects of their Mac. I’ve gone into quite a lot of detail for those who are less technically-minded, but those of a more technical bent can just skip ahead accordingly.

Yahoo! keeps changing the Flickr website and API which keeps breaking some of my instructions, so I’m constantly modifying this post so that it stays up to date for getting your favourites from the new Flickr website to use as a screensaver in Yosemite, Mavericks and Mountain Lion. I last updated these instructions on 28th October 2014 and they tested out fine on that date.

Set up the RSS feed

Thanks to Rudie for emailing me to point out that Flickr has apparently started providing large versions of images in its RSS feeds, so this part is now much simpler than it was before.

Firstly you need to get your Flickr ID. I’ve gone back to using idGettr for this after it stopped working for a while (presumably also due to constant Flickr API changes) but then became operational again. So, follow the simple instructions at idGettr, and what you need to take note of is the Flickr ID, which looks something like 39653492@N07.

Then simply add that to the end of the Flickr photo RSS feed address so you end up with something like this, but with your own Flickr ID at the end instead of mine:

https://api.flickr.com/services/feeds/photos_faves.gne?id=39653492@N07

Paste this link into a temporary place so you can come back to it shortly – a temporary document in TextEdit is as good a place as any.

Create the folders you need on your Mac

From here on it is necessary to venture into the dark underbelly of OS X via the use of the Terminal. So, launch the Terminal app using your preferred launch method. If you’re not sure how to do this, type ⌘-Space to bring up Spotlight, then type “terminal”, then choose “Terminal” in “Applications”, then hit Enter to launch it. Then we make sure we have the folders we will need, so type (or copy and paste) the following line into the Terminal:

mkdir -p ~/Pictures/Flickr_faves ~/Library/Scripts ~/Library/LaunchAgents

Create the script to download the images

The first thing we need to do next is determine what your short username is. On OS X, every user has a long username and a short username. For example, my long username might be “Matt Brock” and my short username might be “mattbrock”. If you already know for sure what your short username is then that’s great. If not, then just type the following into the Terminal and it will tell you:

echo $USER

Make a note of this somewhere if you’re not sure you can remember it. Next we create the script which will get the latest favourites and clear out old ones, so type:

nano ~/Library/Scripts/get_Flickr_faves.sh

This will bring you into a text editor. Paste in the following text:

#!/bin/bash

if ! cd ~/Pictures/Flickr_faves ; then
  logger "get_Flickr_faves: failed to cd to ~/Pictures/Flickr_faves; exiting"
  exit 1
fi

if ! curl -s "http://api.flickr.com/" > /dev/null 2>&1 ; then
  logger "get_Flickr_faves: couldn't connect to Yahoo API; exiting"
  exit 1
fi

curl -s "URL" | grep 'rel="enclosure"' | awk -F '"' '{print $6}' | xargs -L1 curl -s -O

find . -mtime +1 -exec rm -f {} +

NO_IMAGES=$(ls | wc -l | sed "s/ //g")

logger "get_Flickr_faves: completed; $NO_IMAGES images"

Then use the arrow keys on your keyboard to move around. You need to replace URL with the long RSS feed address which you pasted into a temporary location earlier – you can use regular copy and paste, plus the arrow keys and the delete key to do all this. Make sure you don’t change anything else, and make sure you keep the quotation marks around the RSS feed address. Once that’s done, type Ctrl-O, then Enter to confirm, to save the changes. Then type Ctrl-X to exit the text editor. Then type the following to give your new script permission to run:

chmod 755 ~/Library/Scripts/get_Flickr_faves.sh

You can now run the script once to download your Flickr favourites:

~/Library/Scripts/get_Flickr_faves.sh

Hopefully that won’t produce any errors, and if you go into Finder to look in the “Flickr_faves” folder in your Pictures folder, you should see local copies of your Flickr favourites in there.

Tell your Mac to update the images once per day

Next we need to tell your Mac to run the script we just created once a day in order to update the images from your favourites on Flickr. So, run the following command:

nano ~/Library/LaunchAgents/uk.co.mattbrock.Flickr_faves.plist

This will again bring you into a text editor. This time, paste in the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>get_Flickr_faves</string>
  <key>Program</key>
  <string>/Users/USERNAME/Library/Scripts/get_Flickr_faves.sh</string>
  <key>StartCalendarInterval</key>
  <dict>
    <key>Minute</key>
    <integer>15</integer>
    <key>Hour</key>
    <integer>15</integer>
  </dict>
  <key>Debug</key>
  <true/>
  <key>AbandonProcessGroup</key>
  <true/>
</dict>
</plist>

N.B. This assumes that your home directory is in /Users. If you’ve moved your home directory then you’ll need to alter the Program string to point to the alternative location instead of /Users/USERNAME. If you don’t know what this means then ignore it because it almost certainly doesn’t apply to you.

Replace USERNAME with your short username, then type Ctrl-O, Enter, then Ctrl-X to save and exit the editor. This is a set of instructions to tell your Mac to run the script we created earlier once a day in order to make sure your Flickr favourites are kept up to date locally. In order to get your Mac to read and act upon these instructions, we need to run the following:

launchctl load ~/Library/LaunchAgents/uk.co.mattbrock.Flickr_faves.plist

Hopefully that won’t produce any errors. We’re almost there now.

Configure the screensaver on your Mac

So all we need to do now is point the slideshow screensaver at the folder we created earlier to store the images from your Flickr favourites. Go into Desktop & Screen Saver in your System Preferences, click the Screen Saver tab, then choose one of the Slideshows (I prefer “Classic”), then under “Source” choose “Choose Folder…”, then navigate to the Flickr_faves folder in your Pictures folder. It’s up to you whether you choose “Shuffle slide order” – personally I prefer to have that on, as I like a bit of randomness. Then choose a time under “Start after” to determine how soon you’d like the screensaver to start up. Alternatively/additionally, you can click Hot Corners and choose a hot corner to trigger your new screensaver on demand. And that should be it! If all has gone well, your screensaver will now show you all your latest Flickr favourites. Enjoy.

Troubleshooting

You should be able to see the results of this automated script by launching Terminal and then typing:

grep get_Flickr_faves /var/log/system.log

This should show you the times when the task has run and what happened when it tried. When it’s been successful you will see something like the following:

Sep  4 15:17:56 mymac me[27308]: get_Flickr_faves: completed; 37 images

P.S. You can now get the Bash script and launchd XML configuration from GitHub if you so desire.

  • justmeetheman

    Why only 36 images are downloaded?

    • You would have to ask Flickr why they provide 36 images in their RSS feed. Seems like a reasonable enough number to me, though.

  • Ian Lee

    Thanks Matt.. worked great for me..

  • : get_Flickr_faves: completed; 0 images

    Because media:content comes back blank for this feed. Not sure if its all feeds, but definitely the food one i’m trying to subscribe to. So annoyed apple yanked this feature. Hopefully, automator isnt next.

    http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http%3A%2F%2Fapi.flickr.com%2Fservices%2Ffeeds%2Fphotos_public.gne%3Fid%3D13329406%40N00&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss

    • I’ve spent a few minutes trying this myself, and I can’t get it to work with the feed you’re using via the Flickr Feed Image Re-sizer pipe, so something is presumably broken at their end. It’s still fine with favourites feeds though, so this blog post remains completely valid for people (like me) who just want to get their favourites.

  • Todd Stiles

    Hi Matt, also having same problem with this, ran grep and it shows nothing, nothing in faves folder despite running script a few times. I am wondering if the problem is the long URL address from the pipe which I have as

    http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=https%3A%2F%2Fapi.flickr.com%2Fservices%2Ffeeds%2Fphotos_faves.gne%3Fid%3D8290921%40N03&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss

    the pipe generator seems to work fine as it shows a list of my faves, any ideas appreciated Rgds Todd

  • Todd Stiles

    Also the CURL command you suugest in troubleshooting just prints out a number of blank lines

  • billybnyc

    question: Can I feed an album instead of favs? Flickr won’t let you favorite your own pics.

  • zlatty

    They decided to remove this feature in 9.6

    • Indeed they did. I posted a comment here to that effect some time ago, but Disqus seems to have eaten it.

  • Francis Mariani

    Matt, thanks for this technique. I’m using it to create a folder of my favourites that I use as a folder of desktop pictures. When I run the script, it returns only 36 files, even though I have many more favourites. Any ideas, Thanks very much. Francis.

    • As mentioned below in the comments, Flickr only provides 36 images in the RSS feed.

  • jonbel

    hi, has since about a month the script responds with ” 0 pictures found. ” . (i’m using OS X 10.10.3) .
    An idea ?

    • I’m also on 10.10.3 and all I can tell you is that it’s working fine for me currently. I suggest checking your script to make sure it’s up to date, as I’ve had to make several changes to it since I first wrote this post.

      • jonbel

        i’ve changed one thing : i call an url list from an external file , my daily script :

        !/bin/bash

        if ! cd ~/Pictures/wp-flickr ; then
        logger “get_Flickr_faves: failed to cd to ~/Pictures/wp-flickr; exiting”
        exit 1
        fi

        if ! curl -s “http://api.flickr.com/” > /dev/null 2>&1 ; then
        logger “get_Flickr_faves: couldn’t connect to Yahoo API; exiting”
        exit 1
        fi

        rm -rf /users/jon/Pictures/wp-flickr/*

        curl -s “/users/jon//Library/Scripts/flickr_urls.txt” | grep ‘rel=”enclosure”‘ | awk -F ‘”‘ ‘{print $6}’ | xargs -L1 curl -s -O

        find . -mtime +1 -exec rm -f {} +

        NO_IMAGES=$(ls | wc -l | sed “s/ //g”)

        logger “get_Flickr_faves: completed; $NO_IMAGES images”

        my flickr_urls.txt file :
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=80348977@N08&lang=en-us&format=rss_200&Size=Large&_id=1b9eade2dbe6f4f1cf93ed56cb372fb8&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=60041850@N04&lang=en-us&format=rss_200&Size=Large&_id=1b9eade2dbe6f4f1cf93ed56cb372fb8&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=36122572@N08&lang=en-us&format=rss_200&Size=Large&_id=1b9eade2dbe6f4f1cf93ed56cb372fb8&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=60333456@N06&lang=en-us&format=rss_200&Size=Large&_id=1b9eade2dbe6f4f1cf93ed56cb372fb8&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=95572727@N00&lang=en-us&format=rss_200&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss” “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=36587311@N08&lang=en-us&format=rss_200&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss” “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=51734093@N00&lang=en-us&format=rss_200&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=18583713@N06&lang=en-us&format=rss_200&Size=Large&_id=e3db00846a368e0a89f0dcda78368272&_render=rss”
        “http://pipes.yahoo.com/pipes/pipe.run?RSSfeed=http://api.flickr.com/services/feeds/photos_public.gne?id=94229293@N00&lang=en-us&format=rss_200&Size=Large&_id=e05164e376d4f893f8714a72f2c1d0f8&_render=rss”
        “https://500px.com/MaurizioP/rss.xml”
        “https://500px.com/Primo/rss.xml”

        log say : get_Flickr_faves: completed; 0 images

  • George Young

    Hi Matt, I have tried several times to use my flickr photos as my screensaver on my mac, I´ve tried with RSS feeds but doesn´t seems to work as the only thing that appears are the filenames. How can I make it work? Thanks!

    • Can you explain exactly what you have done so far and exactly what results you are getting?

  • Don Richards Jr

    Anyone else getting a lower resolution? Is there any way to specify the Original or High resolution?

    • Depends what you mean by “lower”, I think. The ones I’m getting aren’t huge but are adequate for my needs. We’re dependent on the whims of Flickr. There used to be a Yahoo Pipe which could resize images in Flickr RSS feeds, but Yahoo killed Pipes so that’s no longer available.

  • CannyCookie

    Nice work Matt,

    I’ve tweaked it to get favourite image originals and up to 500 pics from 1 call. You can use this URL. If you want the next 500 results use page=2 parameter.

    https://api.flickr.com/services/rest/?method=flickr.favorites.getPublicList&api_key=YOURAPIKEY&user_id=YOURUSERID&extras=url_o&per_page=500&format=rest.

    Then change the parsing to:-
    curl -s “URL” | grep ‘url_o=’ | awk -F ‘”‘ ‘{print $22}’ | xargs -L1 curl -s -O