Spotlight | Reviews | Current Issue | Newsletter | Subscribe | Contact |
Departments

Partner Links
Website builder
WinWeb OnlineOffice
Shopping and price comparison with product reviews at dooyoo.co.uk

user friendly

CeBIT 2010 CFP

Linux Magazine is offering free booths for the CeBIT 2010 computer fair to selected open source projects. Apply Now!

  linux-magazine.com » Online » Blogs » Productivity Sa... » Quick Tip: Upload Photos to TwitPic with cURL  

Productivity Sauce: Dmitri's open source blend of productive computing
Productivity Sauce: Dmitri's open source blend of productive computing

Quick Tip: Upload Photos to TwitPic with cURL

You can upload photos from your machine to TwitPic using the following command:

curl -F "username=[username]" -F "password=[password]" -F "message=message" -F media=@/path/to/photo.jpg http://twitpic.com/api/uploadAndPost

You need the cURL tool installed on your machine for this command to work. Since cURL is available in the software repositories of most mainstream Linux distributions, you can install it using your distro's package manager.

You might wonder why you'd want to upload photos from the command-line when there are many other ways to do that. The answer is automation. For example, you can write a simple Bash script that transfers all new photos from your camera and then uploads them to TwitPic:

#!/bin/sh
gphoto2 --get-all-files --new
for file /home/user/photos/*.jpg; do
curl -F "username=[username]" -F "password=[password]" -F "message=message" -F media=@$file http://twitpic.com/api/uploadAndPost
done

Comments


Print this page. Recommend
Slashdot it! Delicious Share on Facebook Tweet! Digg

 

In the US and Canada, Linux Magazine is known as Linux Pro Magazine.
Entire contents © 2009 [Linux New Media USA, LLC]
Linux New Media web sites:
North America: [Linux Pro Magazine]
UK/Worldwide: [Linux Magazine]
Germany: [Linux-Magazin] [LinuxUser] [EasyLinux] [Linux-Community] [Linux Technical Review]
Eastern Europe: [Linux Magazine Poland] [Linux Community Poland] [Open Source DVD Poland]
International: [Linux Magazine Brazil] [EasyLinux Brazil] [Linux Magazine Spanish]
Corporate: [Linux New Media AG]