сряда, 26 юни 2013 г.

Flickr_Up - or how to upload all of your pictures to Flickr at once

Hello,
this is my first article and my first Ruby script, so I'm wasting no time and I'm going straight to the point. If you wish to upload all of your JPG pictures to Flickr then follow these steps below. The instructions and examples are for/from Windows, but you can easily convert them for your Linux or Mac. If you have some difficulties write me back I'll try to help you.

First things first:
1. Create a Flickr account if you don't have one already. Go to http://flickr.com

2. Now install Ruby on your system. It depends on your Operating System. If you are using Windows then go to http://rubyinstaller.org/ download & install the package. Make sure that you check the 'Add Ruby executables to your PATH' option as you can see on the picture below.



3. OK, now you'll need to install the Flickr API - Flickraw. For that open up your Command Prompt as admin /On Windows 8 right click in the lower left corner of your screen and select Command Prompt (Admin)/. After that type in the following:
    gem install flickraw
and you should see something similar:

4. To run the Flickr_Up script, you'll need an API key from your Flickr account.
You can find and create your API keys associated with your account at http://www.flickr.com/services/api/keys/

You'll need your *key* and *secret* to run the script.

5. Now go to https://github.com/peyanski/Flickr_Up and download all of the files on the repo. You can use Git or just click on 'Download ZIP' button 

after that extract the archive to a folder of your choice. Rename the 'config.yml.default' to 'config.yml' open it in your favorite text editor and enter the API key and Shared Secret that you get from point 4.

6. Open up the Command Prompt enter to the folder that you extract the archive and type in the following:
    ruby authenticate.rb

Follow the instructions of the script and you should see something similar:
Open this url in your process to complete the authication process : http://www.flickr.com/services/oauth/authorize?oauth_token=AAAAAAAAAAAAAAAAA-bbbbbbbbbbbb&perms=delete
Copy here the number given when you complete the process.
    123-456-789
You are now authenticated as peyanski with token CCCCCCCCCCCCCCCCC-ddddddddddddddddd and secret eeeeeeeeeeeeeeee   
You can now add token (access_token) and (access_secret) secret to your 'config.yml'

7. You will have to choose an existing Flickr Set to upload your files. You can use 'get_phtotsets.rb' script to fetch all existing Flickr sets and to get the ID you want form the generated 'photosets.yml' file. Or you can log on to Flickr and enter to the set that you want to use and after that to copy the ID from the URL in your browser (as example: http://www.flickr.com/photos/your_user/sets/72157631234567890/ - copy only the digits - 72157631234567890)

    ruby get_photosets.rb
    You are now authenticated as peyanski
    photosets.yml saved.

You can now add photoset_id in your 'config.yml' 

8. Change the "target_dir" option in your 'config.yml' file. Use the full path to your pictures folder that you want to upload to Flickr. At the end you should have something like this in your 'config.yml' file

9. Now the fun part. Just type the following in your Command Prompt:
    ruby Flickr_Up.rbAs it says - Congrats! Of course you can upload thousands of pictures not just one as in the example above. I managed to upload 11k JPG files using my TP-Link TL-WR1043ND router for 3 days using this script.

Good Luck!


Няма коментари:

Публикуване на коментар