• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    Ruby
  • Created over 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ruby + Applescript to incrementally back up my iPhoto library to Flickr (abandoned due to the advent of Photos.app)

iPhoto -> Flickr

Ruby + Applescript to incrementally back up my iPhoto library to Flickr.

What it does

Incrementally backs up the contents of an iPhoto library to Flickr. This is especially useful now that Flickr offer 1TB of free space.

More specifically, it:

  • Uses AppleScript to get a list of all photos in the top-level Photos section of iPhoto (this excludes photos shared by others, iPhoto's Trash, and so on).
  • Uploads to Flickr any of those photos it hasn't uploaded before.
  • Uses AppleScript to get a list of all 'regular' iPhoto albums (i.e. not smart albums or automatic ones, like Events or Faces).
  • Creates a photoset on Flickr for any iPhoto album it hasn't already done that for.
  • Adds any photo in an iPhoto album to the corresponding Flickr photoset if it hasn't already done so.

It makes no more than 1 request/second to the API, in line with Flickr's limit of 3600 requests/hour.

Hats off to the flickraw gem for doing all the Flickr donkey work.

Strengths

  • It never deletes a photo or photoset, and it never alters a photo it's already uploaded. For a backup tool this is good: it means the backup can't be affected by loss or corruption of local photos.
  • It's pretty careful not to mess its records up: it keeps append-only logs which are fsynced after every write. So it ought to be safe to Ctrl-C it at any time.

Limitations

  • There's no restore feature to bring photos back from Flickr to iPhoto.
  • Error-handling is minimal: various error conditions (such as no Internet connectivity) will give you a stack trace.

Installation

  1. Make sure you're a geek with a Mac
  2. Request an API key + secret from Flickr
  3. Install Ruby 1.9+ (unless you're on OS X 10.9+, which apparently bundles Ruby 2)
  4. gem install flickraw-cached colorize
  5. git clone https://github.com/jawj/flickrbackup.git
  6. chmod u+x flickrbackup.rb

Usage

./flickrbackup.rb and await further instructions.

On first run you'll be prompted to authenticate with Flickr before backup proceeds. Your OAuth credentials are stored, so on subsequent runs you'll just see something like the following:

Georges-MBP:flickrbackup George$ ./flickrbackup.rb
Authenticated as: george

9025 photos in iPhoto library
4 photos not yet uploaded to Flickr
1. Uploading '/Users/George/Pictures/iPhoto Library/Previews/2013/07/08/20130708-215354/F6hf3i9DTFq0dXcULUNiQQ/IMG_2948.JPG' ... 4294991038 -> 9264815520
2. Uploading '/Users/George/Pictures/iPhoto Library/Previews/2013/07/08/20130708-215354/p6NrRDroSci6hFvRgyi67A/IMG_2949.JPG' ... 4294991036 -> 9264816628
3. Uploading '/Users/George/Pictures/iPhoto Library/Masters/2013/07/08/20130708-215318/IMG_0018.PNG' ... 4294991024 -> 9264817274
4. Uploading '/Users/George/Pictures/iPhoto Library/Previews/2013/07/09/20130709-205846/xpgCtTqTQ+CkFbO0%5PrVA/IMG_2954.jpg' ... 4294991052 -> 9264818976

65 standard albums in iPhoto
Adding photo 4294991034 -> 9264801368 to photoset 4294976678 -> 72157634473345113 ... done
Adding photo 4294991038 -> 9264815520 to photoset 4294976678 -> 72157634473345113 ... done
Adding photo 4294991036 -> 9264816628 to photoset 4294976678 -> 72157634473345113 ... done
Creating new photoset: 'Test album Thursday' ... 4294977929 -> 72157634599278172
Adding photo 4294990998 -> 9230172174 to photoset 4294977929 -> 72157634599278172 ... done
Adding photo 4294991034 -> 9264801368 to photoset 4294977929 -> 72157634599278172 ... done
Adding photo 4294991038 -> 9264815520 to photoset 4294977929 -> 72157634599278172 ... done
Adding photo 4294991036 -> 9264816628 to photoset 4294977929 -> 72157634599278172 ... done

Arrows represent mappings from iPhoto object IDs to Flickr object IDs. All records are stored in ~/Library/Application Support/flickrbackup.

Support and feature requests

I make no promises to enhance or support this script except in as far as it contributes to it backing up my own iPhoto library.

Licence

http://opensource.org/licenses/GPL-3.0

More Repositories

1

IKEv2-setup

Set up Ubuntu Server 20.04 (or 18.04) as an IKEv2 VPN server
Shell
1,248
star
2

zapatos

Zero-abstraction Postgres for TypeScript: a non-ORM database library
TypeScript
1,057
star
3

OverlappingMarkerSpiderfier

Deals with overlapping markers in Google Maps JS API v3, Google Earth-style
JavaScript
819
star
4

subtls

A proof-of-concept TypeScript TLS 1.3 client
JavaScript
333
star
5

OverlappingMarkerSpiderfier-Leaflet

Deals with overlapping markers in the Leaflet maps API, Google Earth-style
CoffeeScript
247
star
6

mostly-ormless

Ergonomic Postgres from TypeScript
TypeScript
202
star
7

websocket-kinect

Streams Kinect data over binary WebSockets to web clients, which visualise using Three.js/WebGL (currently Chrome and Firefox 11+ only)
JavaScript
172
star
8

github-widget

Simple script to display own GitHub projects on a webpage, ordered by number of watchers
CoffeeScript
81
star
9

web-scraping-for-researchers

Press Cmd + Alt + I
JavaScript
33
star
10

js-xre

A small, focused, forward-looking library for extended Regular Expressions in JavaScript, using ES2015+ tagged template literals
JavaScript
24
star
11

Zot2Bib

A Zotero extension that helps you combine the no-typing-required bibliographic magic of Zotero with the TeX-compatibility and Mac-like goodness of BibDesk
JavaScript
23
star
12

pigeonsim

Fly! Courtesy of this small project linking Kinect -> OpenNI -> Processing -> WebSockets -> CoffeeScript -> Google Earth API
CoffeeScript
19
star
13

MapMarkerAwesome

FontAwesome SVG map markers
JavaScript
16
star
14

OSTN02C

C implementation of Ordnance Survey OSTN02 transformation
C
9
star
15

NSMutableAttributedString-InlineStyles

Lightweight inline formatting (*bold*, /italic/, etc.) for NSAttributedString
Objective-C
8
star
16

linode-to-hetzner-xen

7
star
17

PasscodeViewController

A class to set/challenge for a passcode modelled closely on Apple's own, with some tasteful enhancements (iPhone only)
Objective-C
4
star
18

neon-cf-example

JavaScript
3
star
19

cubicsplines

Three kinds of cubic spline calculation CoffeeScript: natural, clamped and monotonic
CoffeeScript
3
star
20

snow-mo

Contribution to the CASA Xmas decoration contest, and a first play with Three.js (the snowflakes are, with very high probability, unique)
HTML
2
star
21

zapatos-docs

Documentation for the Zapatos Postgres/TypeScript library
PLpgSQL
2
star
22

json-custom-numbers

JSON parsing library that enables custom number parsing
JavaScript
1
star
23

spindlytext

A library that lets you write in the sky with the Google Earth API using KML LineStrings
CoffeeScript
1
star
24

hackdoc

CoffeeScript
1
star
25

mtwist

Concise, tested Mersenne Twister in CoffeeScript/JavaScript
C
1
star
26

zapatos-demo

Bits and pieces I use to check and exercise various bits of Zapatos.
TypeScript
1
star
27

bear-test

JavaScript
1
star
28

robinremote

CoffeeScript
1
star
29

jawj.github.com

1
star
30

perfcompare

JavaScript
1
star
31

GJMLessCrashySKView

An SKView stand-in that doesn't crash your app when audio is playing or freeze up when temporarily disappeared
Objective-C
1
star