Sep 29, 2009

Bulk upload photos to facebook [BASH]

I got tired of uploading one photo at a time. So I googled a bit, and found few scripts but none did convince me. So I set to write one by myself. And my focus was to keep it short and simple(KISS).

The tool is a python script with following features:
* Bulk upload the pictures to facebook.
* Supports upload from specified folder or current folder (default).
* Allows to choose from available albums.

Usage:
upload2facebook [-a|--aid <album_id>] [<path>]

Install:
(Don't forget to read the notes below)
In Debian (Ubuntu, Kubuntu,...) system:
1. Install from ppa https://launchpad.net/~ssapkota/+archive/ppa
2. Install directly from deb-package -> upload2facebook_0.2_i386.deb , Package Detail

In RPM (Fedora, Centos) system
3. Install the rpm -> http://ssapkota.com.np/downloads/upload2facebook-0.2-2.i386.rpm

4. Get the source, do whatever you like -> upload2facebook_0.2.tar.gz


Note-1:
During the installation of this tool, it will ask you to enter the Application Key and Application Secret Key. To get this two key you need to register an application for yourself at facebook. Follow the following (necessary) steps:
1. Go to http://www.facebook.com/developers and click on Setup Up New Application at the top right corner.
2. Enter the Application Name (I suggest : Photo Uploader)
3. Then click Agree and then Save Changes
4. After this you will get
API Key and Secret. Copy it and save it somewhere; you'd need later. Remember, these keys are meant to be secret and shouldn't be shared (So, did I ;) ).
5. You need to do one more thing to make it work; On the left-navigation click on the Canvas and then enter a URL(may be your website/blog link) as Canvas Callback URL. I don't think this is of any use for command line application, but to make the application work you need to set this.
6. Thats it. Return to the installer and Enter your App Key and App Secret.

Note-2:
1. The tool is developed and tested in Ubuntu and works in all the Debian system.
2. The RPM package is generated using alien and have not been tested.
3. The code is written in python and is OS independent, One can easily port to any other Operation system.
4. If you have tested the tool in other system or have ported it to other OS, please post the status in the comment.

Enjoy the tool. :)