Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

parallel-flickr

> 编程语言
Open source

parallel-flickr Gentle Introduction Installation The Short Version The Long, Slightly Hand Holding, Version The Here-Be-Dragons Locally Hos…

186 stars0 likes2 views
WebsiteGitHub

About

parallel-flickr Gentle Introduction Installation The Short Version The Long, Slightly Hand Holding, Version The Here-Be-Dragons Locally Hos…

parallel-flickr

  • Gentle Introduction

  • Installation

    • The Short Version

    • The Long, Slightly Hand Holding, Version

    • The Here-Be-Dragons Locally Hosted Version

  • Permissions

    • Flickr Auth tokens

    • Poor man's god auth

  • Backing up photos

    • Backing up photos manually

    • Automagic backing up of your photos

    • Controlling who can backup their photos

  • Storage options

    • Using the local file system

    • Using Amazon's S3 service

    • Using the "storagemaster" service

  • Fancy stuff

    • Solr

    • Uploads

      • Upload - notifications

      • Upload - send to Flickr

      • Upload - send to Parallel-Flickr

      • Upload by the API

      • Upload by email

    • Filt(e)ring uploads

    • API

  • Experimental stuff

  • TO DO

Gentle Introduction

parallel-flickr is a tool for backing up your Flickr photos and generating a database backed website that honours the viewing permissions you've chosen on Flickr. It uses the Flickr API as a single-sign-on provider, for user accounts, and to archive the photos, favourites and contact list from your Flickr account.

parallel-flickr is not a replacement for Flickr. It is an effort to investigate – in working code – what it means to create an archive of a service as a living, breathing "shadow" copy rather than a snapshot frozen in time.

parallel-flickr is still a work in progress. It is more than an idle research project. It is working code that I use every day. On the other hand it is also not a full-time gig so I work on it during the mornings and the margins of the day so it is not pretty or particularly classy, yet.

It almost certainly still contains bugs, some of them might be a bit stupid. That includes this documentation which aims to be basically completely but is not yet completely complete.

There is still not a one-button installation process and configuring parallel-flickr might seem a bit daunting for that reason. This is far from ideal and there is lots of room for improvement in the future. Suggestions and gentle cluebats are welcome and encouraged.

The longer versions are contained in a variety of blog posts and talks that I've done about parallel-flickr:

  • Parallel Flickr, October 2011

  • A talk about Parallel Flickr at the Personal Digital Archiving conference, February 2012

Installation

The Short Version

parallel-flickr is built on top of Flamework which means it's nothing more than a vanilla Apache + PHP + MySQL application. You can run it as a dedicated virtual host or as a subdirectory of an existing host.

You will need to make a copy of the config.php.example file and name it config.php. You will need to update this new file and add the various specifics for databases and third-party APIs.

# You will need valid Flickr API credentials
# See also: http://www.flickr.com/services/apps/create/apply/

$GLOBALS['cfg']['flickr_api_key'] = '';
$GLOBALS['cfg']['flickr_api_secret'] = '';	

$GLOBALS['cfg']['flickr_api_perms'] = 'read';

# You will need to setup a MySQL database and plug in the specifics
# here: https://github.com/straup/parallel-flickr/blob/master/schema
# See also: https://github.com/straup/flamework-tools/blob/master/bin/setup-db.sh

$GLOBALS['cfg']['db_main'] = array(
	'host' => 'localhost',
	'name' => 'parallel-flickr',
	'user' => 'parallel-flickr',
	'pass' => '',
	'auto_connect' => 1,
);

# You will need to set up secrets for the various parts of the site
# that need to be encrypted. Don't leave these empty. Really.
# You can create new secrets by typing `make secret`.
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/generate_secret.php

$GLOBALS['cfg']['crypto_cookie_secret'] = '';
$GLOBALS['cfg']['crypto_crumb_secret'] = '';
$GLOBALS['cfg']['crypto_password_secret'] = '';

# If you don't have memcache installed (or don't even know what that means)
# just leave this blank. Otherwise change the 'cache_remote_engine' to
# 'memcache'.

$GLOBALS['cfg']['cache_remote_engine'] = '';
$GLOBALS['cfg']['memcache_host'] = 'localhost';
$GLOBALS['cfg']['memcache_port'] = '11211';

# This is only relevant if are running parallel-flickr on a machine where you
# can not make the www/templates_c folder writeable by the web server. If that's
# the case set this to 0 but understand that you'll need to pre-compile all
# of your templates before they can be used by the site.
# See also: https://github.com/straup/parallel-flickr/blob/master/bin/compile-templates.php

$GLOBALS['cfg']['smarty_compile'] = 1;

The Long, Slightly Hand Holding, Version

Get the code from GitHub.

Decide on whether you'll host this on a sub-domain (something along the lines of parallel-flickr.example.com) or in a subdirectory (maybe something like www.example.com/parallel-flickr).

This rest of this section will assume the following:

  • That you'll be hosting on a subdomain called parallel-flickr on a domain called example.com, or, to put it another way parallel-flickr.example.com. Just mentally substitute your domain and sub-domain when reading, and physically substitute your domain and sub-domain during the installation process. Unless you actually own the example.com.
  • That you'll be using Flickr for reverse-geocoding and not an instance of the reverse-geoplanet web-service.
  • That you want the URL for parallel-flickr to be parallel-flickr.example.com and not parallel-flickr.example.com/www
  • That you want parallel-flickr to be on a public facing web service. You can install it on a local machine that isn't publicly accessible but to do this needs some careful copying-and-pasting of database settings from a public facing machine to your local, private machine. See the Here-Be-Dragons Locally Hosted Version Below if you want to get your hands dirty.
  • That `` is the path on your webserver where your web server has been configured to find the sub-domain.
  • That you have shell access (probably via SSH) to your web server.

Register with Flickr - go to http://www.flickr.com/services/apps/create/apply/

  • Apply for a non-commercial key
  • Set the App name to parallel-flickr (or something that's meaningful to you)
  • Set the App description to something meaningful, such as An instance of https://github.com/straup/parallel-flickr
  • Tick both boxes!
  • Note the API key and API secret the registration process gives you (it's a good idea to save this in a new browser window or tab so you can copy-and-paste)

Now ... upload the code, plus all sub-directories to your web-server; don't forget the (hidden) .htaccess file in the root of the code's distribution.

Copy /www/include/config.php.example to /www/include/config.php and edit this new file.

Copy-and-paste your Flickr Key into the section of the config file that looks like ...

$GLOBALS['cfg']['flickr_api_key'] = 'my-flickr-key-copied-in-here';
$GLOBALS['cfg']['flickr_api_secret'] = 'my-flickr-secret-copied-in-here';	

$GLOBALS['cfg']['flickr_api_perms'] = 'read';

Set up your database name, database user and database password. Copy and paste these into ...

$GLOBALS['cfg']['db_main'] = array(
	'host' => 'localhost',
	'name' => 'my-database-name',
	'user' => 'my-database-user',
	'pass' => 'my-database-users-password',
	'auto_connect' => 0,
);

Setup your encryption secrets secrets. SSH to your host and run php /bin/generate_secret.php, 3 times. Copy and paste each secret into

$GLOBALS['cfg']['crypto_cookie_secret'] = 'first-secret-here';
$GLOBALS['cfg']['crypto_crumb_secret'] = 'second-secret-here';
$GLOBALS['cfg']['crypto_password_secret'] = 'third-secret-here';

(If you don't have shell access to your web-server, you can run this command from the shell on a local machine)

Create the database tables. Load /schema/db_main.schema, /schema/db_tickets.schema and /schema/db_users.schema into the database. You can do this either via phpMyAdmin and the import option or via mysql on the shell's command line

Browse to http://parallel-flickr.example.com

If you get errors in your Apache error log such as ...

www/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration

... then your host is probably running PHP as a CGI and not as a module so you'll want to comment out any line in /www/.htaccess that starts with php_value or php_flag and put these values into a new file, /www/php.ini, without the leading php_value or php_flag.

Click on sign in w/ flickr and authenticate with Flickr.

You might want to put this command in a cron job, if your web host allows this.

That's it. Or should be. If I've forgotten something please let me know or submit a pull request.

The Here-Be-Dragons Locally Hosted Version

If you really want to hack and play around with parallel-flickr, it's best to do this on a private, locally hosted machine, like your laptop or your desktop machine. But as a starting point you need to have followed the installation instructions above as you need to have a public facing installation first and then clone this to your local machine. The reason for this is that you need to authenticate with Flickr, Flickr uses FlickrAuth or OAuth to authenticate and OAuth authentication needs a publicly accessible web server to authenticate with. With that said, roll up your sleeves, grab a cup of your caffeinated beverage of choice and follow along.

This rest of this section will assume the following:

  • That you're running MAMP on a Mac. MAMP is a nice convenient way to run MySQL, Apache and PHP on a Mac. There's also a Windows version called WAMP. Or most Linux distros come with all of this installed. YMMV so you may need to change some paths and file names.
  • That you'll set up a local host name called parallel-flickr
  • That your MAMP installation is running Apache on port 8888 and MySQL on port 8889.

So ... firstly create a local host name by adding parallel-flickr to your /etc/hosts file, which will look something like this ...

127.0.0.1	localhost parallel-flickr

On some operating systems, this file is re-read each time your browser is re-started. On Mac OS X, you'll also need to flush and reload the machine's DNS cache ...

$ sudo /usr/bin/dscacheutil -flushcache

Now create a new virtual host on your machine. Edit /Applications/MAMP/conf/apache/httpd-vhosts.conf and append the magic incantation ...

	ServerName parallel-flickr:8888
	DocumentRoot "/Applications/MAMP/htdocs/parallel-flickr/www"

Restart Apache in MAMP. Create /Applications/MAMP/htdocs/parallel-flickr/www. Browse to http://parallel-flickr:8888. Check you get an empty directory listing of / to e

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHP

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言