flickrpy + 30 lines of code = poor man's Flickr Backup solution

It uses somewhat buggy but excellent flickrpy module by James Clarke — works well for me after some small adjustments:

def main():
    flickr.API_KEY = constants.API_KEY
    flickr.API_SECRET = constants.API_SECRET
    
    u = flickr.User(id = '92002612@N00')
    sets = u.getPhotosets()
    
    for ps in sets:
        name = ps.title
        name = name.replace('"', "'").replace("/", "_")
        
        folderName = "/Users/kirillov/Pictures/Flickr/%s" % name
        if os.path.exists(folderName):
            print("Path exists, skipping: %s" % folderName )
            continue

        photos = ps.getPhotos()
        
        os.mkdir(folderName)
        i = 0
        for i,p in enumerate(photos):
            src = p.getSizes()[-1]['source']
            photoname = p.getTitle().replace("/", "_")
            
            fname = '/Users/kirillov/Pictures/Flickr/%s/%s-%d.jpg' % (name, photoname, i)
            data = u2.urlopen(src).read()
            open(fname, 'w').write(data)
            
            print('%s => "/Users/kirillov/Pictures/Flickr/%s/%s-%d.jpg"' % (src,name, photoname, i))

Upd: fixed and updated version posted.

Filed under  //   geek   photo   python  

Comments [5]

Autumn in Ravenscourt Park

Decided to have a short walk today – before diving in into studying. It was good :)

           
Click here to download:
Autumn_in_Ravenscourt_Park_tag.zip (9125 KB)

Filed under  //   photo  

Comments [0]

Sunset behind the office window

At the moment of writing all these unbelievable colours are already gone :) Too bad it didn't last for long.

   
Click here to download:
Sunset_behind_the_office_windo.zip (2994 KB)

R.

Filed under  //   photo   work  

Comments [0]

Err .. @vicchi doing what?!

       
Click here to download:
Err_.._vicchi_doing_what_tag_p.zip (578 KB)
Filed under  //   fowa   photo   ydn  

Comments [0]

Yahoo! booth at Future of Web Apps

Here we're - it's pretty quite here right now but things will get hotter soon!

                   
Click here to download:
Yahoo_booth_at_Future_of_Web_A.zip (2707 KB)

Filed under  //   event   fowa   geek   photo  

Comments [0]

Friday night at Trafalgar Square

I really love this place – probably, one of my most favourite here in London. Well, not only here and not only in London – just take a look yourself.

                 
Click here to download:
Friday_night_at_Trafalgar_Squa.zip (1835 KB)

Filed under  //   photo  

Comments [0]

Me and Natalie on our friends' wedding

I bet you're surprised I do not look as smart as the rest of the guests (and not even nearly as smart as my beautiful wife). Well, that's because I've been the most miserable person there – namely photographer, and spend the whole day jumping around with the camera (with two cameras, in fact), so at 12AM when guests were enjoying the Spanish wine and truly delicious food from the hotel's restaurant, I fought myself to not fall asleep right where I was sitting.

Filed under  //   photo  

Comments [0]

Night computing

The red spot on the right is, obviously, the Microsoft's IntelliMouse.

Filed under  //   photo  

Comments [0]

Walks with my sister and 50mm

Yep, my sister indeed is in London. And she's doing pretty well, you see!

We had a nice walk  down the London streets – from Soho to Hyde Park, via Piccadilly and Green Park, photographing everywhere within our reach and behaving like a real, natural tourists!

Rest of the photographs are here in my Flickr.

     
Click here to download:
Walks_with_my_sister_and_50mm_.zip (3157 KB)

Filed under  //   photo  

Comments [0]

About

A mad-eye programmer. No, really!