What is a gravatar?

A gravatar, or globally recognized avatar, is quite simply an avatar image that follows you from weblog to weblog (or wiki) appearing beside your name when you comment on gravatar enabled sites. Avatars help identify your posts on web forums, so why not on weblogs and wikis?

How do I get a gravatar?

Signing up for a gravatar.com account is FREE, and all that's required is your email address. Once you've signed up you can upload your avatar image and soon after you'll start seeing it on gravatar enabled weblogs and wikis!

Sign up now!

Gravatar Extension
Vendor
MindTouch
Type Script
Categories Graphics
Requires MindTouch Deki 8.05.2 or later
Status Stable
License Free/Open Source
Manifest http://scripts.mindtouch.com/gravatar.xml

 

Table of Contents

Description

This extension allows embedding of Gravatar images.

See also How to add a script, Using the Extension Dialog, Learn about DekiScript, Extensions Directory.


Functions

gravatar(emailhash, size, rating, default) : xml

Embed a Gravatar image.

Parameters:

NameTypeDescription
emailhashstr(optional) Plain email address, or hash of email address. (default: current user email)
sizenum(optional) Image size. (default: 80)
ratingstr(optional) Image rating. (one of "g", "pg", "r", or "x"; default: "g")
defaultstr(optional) Default image. (one of "identicon", "wavatar", "monsterid", or custom image uri; default: gravatar logo)


Script Source

<extension>
	<title>Gravatar Extension</title>
	<label>Gravatar</label>
	<copyright>Copyright (c) 2006-2009 MindTouch, Inc.</copyright>
	<description>This extension allows embedding of Gravatar images.</description>
	<uri.help>http://wiki.developer.mindtouch.com/MindTouch_Deki/Extensions/Gravatar</uri.help>
  <uri.logo>http://scripts.mindtouch.com/logos/gravatar-logo.png</uri.logo>

  <requires host="MindTouch Deki 8.05.2" />

  <function>
		<name>gravatar</name>
		<description>Embed a Gravatar image.</description>
    <param name="emailhash" type="str" optional="true">Plain email address, or hash of email address. (default: current user email)</param>
    <param name="size" type="num" optional="true">Image size. (default: 80)</param>
    <param name="rating" type="str" optional="true">Image rating. (one of "g", "pg", "r", or "x"; default: "g")</param>
    <param name="default" type="str" optional="true">Default image. (one of "identicon", "wavatar", "monsterid", or custom image uri; default: gravatar logo)</param>
    <return>
			<html xmlns:eval="http://mindtouch.com/2007/dekiscript">
				<body>
          <eval:block value="var hash = $emailhash ?? user.emailhash">
            <img eval:src="uri.appendquery(uri.appendpath('http://www.gravatar.com/avatar', string.contains(hash, '@') ? string.hash(hash) : hash), { s: $size, r: $rating, d: $default })" />
          </eval:block>
				</body>
			</html>
		</return>
	</function>
</extension>


Samples

  Output

To show the current user's gravatar:

{{ gravatar(user.emailhash) }} 

 

Tag page
Viewing 1 of 1 comments: view all
I added this extension and I can use it manually, but it does not appear in the Extensions dialog box with all of the other extensions which I have successfully added.
Posted 21:10, 31 Jul 2008
Viewing 1 of 1 comments: view all
You must login to post a comment.