Downloading an Image from Gravatar Using the Command Line

I am signed up for the alpha, and wanted to upload my avatar picture. Unfortunately, I can't find my avatar picture anywhere on my computer.

Gravatar is a free service that allows you to save your avatar (picture) for use by multiple websites. Gravatar has a copy of the avatar I wanted, so I hoped I could just download it via the same user interface you use to upload images. It turns out that you can't do that: the user interface lets you upload pictures, but does not provide a download option. So I had to figure out how to retrieve my image the way that a Gravatar web client would.

According to the Gravatar documentation, one can get a image for a user by doing an HTTP GET with a URL of this form:

where HASH is the MD5 hash of the user's email address. You can calculate this using the md5 command-line utility.

So, here is the complete command line that will calculate my MD5 hash and the retrieve the image using the curl utility:

© 2003-2023 Kristopher Johnson