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).
- Update 25/04-2010: Error fixed: "unexpected end of file".
- Update 21/03-2010: Added scaling before upload.
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)
Create an account at flickr.com (if you haven't got one already)
Install libflickr-api-perl and ImageMagick
sudo apt-get install libflickr-api-perl imagemagick
Download the flickr command line uploader:
Uncompress the downloaded file
tar zxvf flickr-upload.tar.gz
Jump into the uncompressed folder
Run make command
Check for errors
Install the uploader
sudo make install
From here you can only continue if the install went well.
Run the command and follow the instructions by copying the URL into your browser
You will be sendt to Flickr's website and asked to login and agree that Flickr::Upload can access your account.
After you have finished the wizard on the website press Enter on the command line and a token will show up.
Copy and paste the token into a new file ".flickrrc" located in your home folder. Open/create file
Put this into the file
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
- 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)
- We will call the upload-folder "flickr" and create some sub-folders inside
mkdir flickr flickr/private flickr/family flickr/friend flickr/public flickr/uploaded
- Download the flickr.sh-file 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
The terminal should tell if the image is getting uploaded. Also go to flickr.com an check your photostream.
- Now we will create a periodic job to make the upload happen
Your crontab should look something like this
# 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.