robohash: adding a robot-based hashing tool.

db4
John Benediktsson 2015-04-01 14:56:23 -07:00
parent 5e1c0580d7
commit ce48bb2ebf
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1 @@
John Benediktsson

View File

@ -0,0 +1,23 @@
! Copyright (C) 2011 John Benediktsson.
! See http://factorcode.org/license.txt for BSD license.
USING: images.http kernel sequences urls urls.encoding ;
IN: robohash
<PRIVATE
: robohash-url ( str -- url )
url-encode "http://robohash.org/" prepend >url ;
: (robohash) ( str type -- image )
[ robohash-url ] [ "set" set-query-param ] bi*
load-http-image ;
PRIVATE>
: robohash1 ( str -- image ) "set1" (robohash) ;
: robohash2 ( str -- image ) "set2" (robohash) ;
: robohash3 ( str -- image ) "set3" (robohash) ;

View File

@ -0,0 +1 @@
Robohash!