Skip to content

Commit

Permalink
gravatar: wrapper for Gravatar.com service.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Mar 28, 2019
1 parent 6f58118 commit 88abc4e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions extra/gravatar/authors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
John Benediktsson
18 changes: 18 additions & 0 deletions extra/gravatar/gravatar.factor
Original file line number Diff line number Diff line change
@@ -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. ;
1 change: 1 addition & 0 deletions extra/gravatar/summary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wrapper for the Gravatar service.

0 comments on commit 88abc4e

Please sign in to comment.