So, a few months ago, Flickr decided to change their terms and conditions so that they could sell your Creative Commons photos. This got a lot of people’s goat, myself included since I’m a paid user, and have been for a while (as an aside, had Yahoo done it as a profit share, it would have been awesome for everybody, but noooo…)

Because self hosting in this post Snowden world is only ever going to be a good thing, I don’t want my family photos used in corporate branding without a cut, and because I wanted to be a good #indieweb citizen, I thought I’d take the plunge and move to self hosting.

I’ve tried this before with Trovebox Community Edition but didn’t have much success – while their Flickr data export seemed to work, the import didn’t. They’ve probably got it working by now, but I pretty much gave up.

Anyway, since I’m a contributor to Known, I thought I’d dogfood and hack together an importer.

Flickr Importer for Known

The importer works by calling the Flickr API using credentials stored in your linked Flickr account. To do this, it uses the Flickr syndication plugin to do the donkey work of linking your accounts.

Once activated, and your Flickr account is linked, you are given the option to run an import.

The import job will run in the background, and will import all your photos and videos into your photostream (using the Photo and Media plugins which should also be activated), preserving timestamps, titles, body and tags.

At the time of writing I’ve not got it importing photosets and collections, since Known currently lacks a logical mapping, but I’m keen to at least record this information for later processing. The script will import sets and collections as generic data items, which you can expose by writing support into your theme.

The plugin records state, so it should recover from crashes, and you can re-sync safely at any time.

Have a play and let me know what you think! Pull requests are of course welcome.

» Visit the project on Github...

Following on from my last post about saving Facebook tagged photos to ownCloud, here’s a plugin that addresses my Flickr favourites rule.

This plugin, when set up on IFTTT, will use exactly the same mechanism to save any public photos I tag as a favourite on Flickr to my owncloud folder.

Here’s my flickrfaves.php

]*src *= *["\']?([^"\']*)/', $object->description, $matches))
                {
                        $url = $matches[1];

                        $parsed = parse_url($url);

                        if ($object->pass == $this->expected_password) {
                        
                                $filename = basename($parsed['path']);

                                file_put_contents($this->owncloud_path.$filename, file_get_contents($url));
                        }
                }
            
            return $object;
        }
    }

Dan Coulter has written a very nice WordPress plugin that lets you easily add flickr photos and flickr galleries to a blog.

I use this over on a number of sites to link to various resources hosted on Flickr.

Unfortunately, the plugin as is does not work very well over HTTPS, since it references resources (javascript, css and flicker thumbnails) over HTTP. At the very least this can leak information about the page you are viewing, but in more modern browsers, the request itself is blocked and the page may not function correctly.

There was no obvious way to push patches upstream, so for now I’ve created my own fork of the code, and have stuck it on github.

Hopefully this’ll be useful to you!

» Visit the project on Github...