diff --git a/extra/gravatar/authors.txt b/extra/gravatar/authors.txt new file mode 100644 index 0000000000..e091bb8164 --- /dev/null +++ b/extra/gravatar/authors.txt @@ -0,0 +1 @@ +John Benediktsson diff --git a/extra/gravatar/gravatar.factor b/extra/gravatar/gravatar.factor new file mode 100644 index 0000000000..8a068f1fa3 --- /dev/null +++ b/extra/gravatar/gravatar.factor @@ -0,0 +1,18 @@ +! Copyright (C) 2011 John Benediktsson +! See http://factorcode.org/license.txt for BSD license + +USING: accessors assocs classes.tuple formatting http.client +images.http json.reader kernel sequences strings ; + +IN: gravatar + +TUPLE: info aboutMe accounts currentLocation displayName emails +hash id ims name phoneNumbers photos preferredUsername +profileBackground profileUrl requestHash thumbnailUrl urls ; + +: gravatar-info ( gravatar-id -- info ) + "http://gravatar.com/%s.json" sprintf http-get nip + >string json> "entry" of first info from-slots ; + +: gravatar. ( gravatar-id -- ) + gravatar-info thumbnailUrl>> http-image. ; diff --git a/extra/gravatar/summary.txt b/extra/gravatar/summary.txt new file mode 100644 index 0000000000..a0a5656049 --- /dev/null +++ b/extra/gravatar/summary.txt @@ -0,0 +1 @@ +Wrapper for the Gravatar service.