Quick Tip: Upload Photos to TwitPic with cURL

Dmitri Popov

Productivity Sauce

Oct 08, 2009 GMT
Dmitri Popov

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 powered by Disqus

Issue 163/2014

Buy this issue as a PDF

Digital Issue: Price $9.99
(incl. VAT)

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia