Spotlight | Reviews | Current Issue | Academy | Newsletter | Subscribe | Shop |
Departments

Partner Links
Make your own website
WinWeb OnlineOffice
Comparing prices of hardware is worth it.
Price Comparison
UK Linux Jobs
What:
Where:
Country:
vacatures Netherlands njobs Linux vacatures
arbeit Deutschland njobs Linux arbeit
work United Kingdom njobs Linux jobs
Lavoro Italia njobs Linux lavoro
Emploi France njobs Linux emploi
trabajo Espana njobs Linux trabajo

user friendly

Admin Magazine

ADMIN Network & Security

Subscribe now and save!

ADMIN - Explore the new world of system administration! Special introductory offer! Order by September 30th to save 10% off the regular subscription price! Each issue delivers technical solutions to the real-world problems you face every day. Learn the latest techniques for better:

  • network security
  • system management
  • troubleshooting
  • performance tuning
  • virtualization
  • cloud computing

 

on Windows, Linux, Solaris, and popular varieties of Unix.

http://www.admin-magazine.com/

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

Productivity Sauce
Productivity Sauce

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
Share