[Pharo-dev] Checking your Gravatar

Sven Van Caekenberghe sven at stfx.eu
Mon Aug 12 18:46:36 EDT 2013


Hi,

Related to the usage of Gravatars (http://en.wikipedia.org/wiki/Gravatar) for http://contributors.pharo.org here is some code you can use to check whether your Gravatar image really works:

ZnClient new 
  beOneShot; 
  url: 'http://www.gravatar.com/avatar';
  addPathSegment: (ZnDigestAuthenticator md5Hash: 'sven at stfx.eu');
  queryAt: #s put: '128';
  queryAt: #d put: '404';
  get;
  isSuccess.
		
ZnClient new 
  beOneShot; 
  url: 'http://www.gravatar.com/avatar';
  addPathSegment: (ZnDigestAuthenticator md5Hash: 'nobody.at.all at gmail.com');
  queryAt: #s put: '128';
  queryAt: #d put: '404';
  get;
  isSuccess.

(ZnClient new 
  enforceHttpSuccess: true;
  beOneShot; 
  url: 'http://www.gravatar.com/avatar';
  addPathSegment: (ZnDigestAuthenticator md5Hash: 'tudor at tudorgirba.com');
  queryAt: #s put: '128';
  queryAt: #d put: '404';
  contentReader: [ :entity | ImageMorph fromStream: entity readStream ];
  get) openInWindow.

And now you know how simple Gravatars really are, provided you use a proper programming language to access them.

Enjoy!

Sven





More information about the Pharo-dev mailing list