Skip to content

Instantly share code, notes, and snippets.

@rgchris
Last active December 20, 2018 01:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rgchris/a97dc213f7e97d2ec8a45dd80295b60c to your computer and use it in GitHub Desktop.
Gravatar Lookup for Rebol and Red
Rebol [
Title: "Get Gravatar"
File: %gravatar.r
Date: 27-Nov-2012
Purpose: "Generate Gravatar Profile Image URLs"
]
gravatar: use [to-md5][
to-md5: func [val [any-string!]][
lowercase enbase/base checksum/method to binary! lowercase trim form val 'md5 16
]
func [
"Obtain the Gravatar Profile Image for the given Email Address"
email [email!] "Email Address to Lookup"
][
rejoin [http://www.gravatar.com/avatar/ to-md5 email]
]
]
Red [
Title: "Get Gravatar"
File: %gravatar.red
Date: 19-Dec-2018
Purpose: "Generate Gravatar Profile Image URLs"
]
gravatar: func [
"Obtain the Gravatar Profile Image for the given Email Address"
email [email!] "Email Address to Lookup"
][
rejoin [http://www.gravatar.com/avatar/ lowercase enbase/base checksum lowercase trim form email 'md5 16]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment