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)
1 ) Create an account at flickr.com (if you haven't got one already)
2 ) Install libflickr-api-perl and ImageMagick
3 ) Download the flickr command line uploader:
sudo apt-get install libflickr-api-perl imagemagick
4 ) Uncompress the downloaded file
5 ) Jump into the uncompressed folder
tar zxvf flickr-upload.tar.gz
6 ) Run Makefile.PL
7 ) Run make command
8 ) Check for errors
9 ) Install the uploader
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
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
Put this into the file
You can now test if the uploader works by running the command
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)
14 ) We will call the upload-folder "flickr" and create some sub-folders inside
15 ) Download the file attached to this thread and save it as flickr.sh inside the flickr-folder.
mkdir flickr flickr/private flickr/family flickr/friend flickr/public flickr/uploaded
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.
16 ) Now we will create a periodic job to make the upload happen
Your crontab should look something like this
This will call the script every 5 minut.
# m h dom mon dow command
*/5 * * * * $HOME/flickr/flickr.sh
That's about it. You are ready to upload photos. Oh yeah and do tell if this was useful