Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: HOWTO: Automatic photo upload to Flickr from folder

  1. #1
    Join Date
    Jun 2007
    Location
    Denmark
    Beans
    28

    HOWTO: Automatic photo upload to Flickr from folder

    Update 25/04-2010: Error fixed: "unexpected end of file"
    Update 21/03-2010: Added scaling before upload

    I was looking for a way to upload my photos to flickr.com just by putting the photos into a specific folder, but was not able to find any working solution. So I made a shell script to do this for me. For this to work I'm using a perl command line uploader (which I'm not the author of).


    In the end you will have five folders:
    • "private" - photos only viewable by you
    • "friend" - photos only viewable by friends
    • "family" - photos only viewable by friends and family
    • "public" - photos viewable by everybody
    • "uploaded" - photos will be moved here after upload (I prefer to move the photos instead of deleting them)



    Here goes:

    1 ) Create an account at flickr.com (if you haven't got one already)

    2 ) Install libflickr-api-perl and ImageMagick
    Code:
    sudo apt-get install libflickr-api-perl imagemagick
    3 ) Download the flickr command line uploader:
    http://search.cpan.org/~cpb/Flickr-Upload/flickr_upload

    4 ) Uncompress the downloaded file
    Code:
    tar zxvf flickr-upload.tar.gz
    5 ) Jump into the uncompressed folder
    Code:
    cd flickr-upload
    6 ) Run Makefile.PL
    Code:
    perl Makefile.PL
    7 ) Run make command
    Code:
    make
    8 ) Check for errors
    Code:
    make test
    9 ) Install the uploader
    Code:
    sudo make install
    From here you can only continue if the install went well.

    10 ) Run the command and follow the instructions by copying the URL into your browser
    Code:
    flickr_upload --auth
    You will be sendt to Flickr's website and asked to login and agree that Flickr::Upload can access your account.

    11 ) After you have finished the wizard on the website press Enter on the command line and a token will show up.

    12 ) Copy and paste the token into a new file ".flickrrc" located in your home folder. Open/create file
    Code:
    nano ~/.flickrrc
    Put this into the file
    Code:
    auth_token=<your-token-here>
    is_public=0
    is_friend=1
    is_family=1
    You can now test if the uploader works by running the command
    Code:
    flickr_upload your-image.jpg
    13 ) Now decide the location of the upload-folder. I'll presume that you will use your home folder. Jump to the folder (if you are not already there)
    Code:
    cd ~/
    14 ) We will call the upload-folder "flickr" and create some sub-folders inside
    Code:
    mkdir flickr flickr/private flickr/family flickr/friend flickr/public flickr/uploaded
    15 ) Download the file attached to this thread and save it as flickr.sh inside the flickr-folder.

    Before you continue check if the shell-script works. Do this my placing an image in the "private"-folder. Next run the command to start upload
    Code:
    bash ~/flickr/flickr.sh
    The terminal should tell if the image is getting uploaded. Also go to flickr.com an check your photostream.

    16 ) Now we will create a periodic job to make the upload happen
    Code:
    crontab -e
    Your crontab should look something like this
    Code:
    # m h  dom mon dow   command
    */5 * * * * $HOME/flickr/flickr.sh
    This will call the script every 5 minut.


    That's about it. You are ready to upload photos. Oh yeah and do tell if this was useful
    Attached Files Attached Files
    Last edited by skooter; April 25th, 2010 at 05:21 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    London, UK
    Beans
    36
    Distro
    Ubuntu UNR

    Question Re: HOWTO: Automatic photo upload to Flickr from folder

    At last!! This is exactly what I have been looking for.

    Thank you for putting all this together in a way that even I can follow

    Unfortunately I am getting as error when i try to run the script:

    line 129: syntax error: unexpected end of file

    I'm sure this is simple to solve so sorry for the newbie question!

  3. #3
    Join Date
    Jun 2007
    Location
    Denmark
    Beans
    28

    Re: HOWTO: Automatic photo upload to Flickr from folder

    Sorry about that Jeeevs. Should be fixed now. Somehow I got it save in a non-unix system (no names) before uploading it. My bad.

    I'm really glad you liked the article and that it was understandable

  4. #4
    Join Date
    Apr 2010
    Location
    ny
    Beans
    1
    Distro
    Ubuntu

    Re: HOWTO: Automatic photo upload to Flickr from folder

    nice tutorial tanks mate. realy interesting i didnt know i can do that

  5. #5
    Join Date
    Jun 2007
    Location
    Denmark
    Beans
    28

    Re: HOWTO: Automatic photo upload to Flickr from folder

    No problemo

  6. #6
    Join Date
    Jan 2006
    Location
    London, UK
    Beans
    36
    Distro
    Ubuntu UNR

    Lightbulb Re: HOWTO: Automatic photo upload to Flickr from folder

    If your using the upload script on its own you can also install term::progressbar. This will give you a progress bar as your files are uploaded.

    Code:
    sudo apt-get install libterm-progressbar-perl
    then just add --progress to the fickr_upload command to show live progress.

    Code:
    flickr_upload --progress your-image.jpg
    Obviously this isn't required with the flickr.sh script, but I thought people might find it useful!

    Thanks again skooter for putting this together.

    Jeeves

  7. #7
    Join Date
    May 2011
    Beans
    1

    Re: HOWTO: Automatic photo upload to Flickr from folder

    Hey!! Nice tutorials. Thanks

  8. #8
    Join Date
    Apr 2012
    Beans
    1

    Re: HOWTO: Automatic photo upload to Flickr from folder

    Great script, thanks a lot!!!

  9. #9
    Join Date
    Aug 2005
    Location
    Amsterdam
    Beans
    55
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOWTO: Automatic photo upload to Flickr from folder

    The best most stable option so far! and I've tried them all! flickrfs looked promising.. But way to old, and not maintained anymore.

    But something like this needs no maintenance. Perfect.

    Is there a way to upload using sets? Something like : make the directory you put in "public" the set name?

  10. #10
    Join Date
    Mar 2006
    Location
    Sweden
    Beans
    6
    Distro
    Dapper Drake Testing/

    Re: HOWTO: Automatic photo upload to Flickr from folder

    Thanks!
    I'll be testing it.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •