gravatar-0.8.1: Generate Gravatar image URLs
Safe HaskellNone
LanguageHaskell2010

Network.Gravatar

Contents

Synopsis

Documentation

gravatar :: GravatarOptions -> Text -> String Source #

Return the avatar for the given email using the provided options

>>> gravatar def "pbrisbin@gmail.com"
"https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"

Whitespace is trimmed.

>>> gravatar def " pbrisbin@gmail.com   "
"https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"

Case is ignored.

>>> gravatar def "PBrisbin@GMAIL.com"
"https://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998"

Options are supported.

>>> :{
  let opts = GravatarOptions
          { gSize = Just $ Size 24
          , gDefault = Just NotFound
          , gForceDefault = ForceDefault True
          , gRating = Just G
          , gScheme = Http
          }
  in gravatar opts "pbrisbin@gmail.com"
:}
"http://www.gravatar.com/avatar/2be502055b6c21ff470730beead2a998?s=24&d=404&f=y&r=g"

Options

data GravatarOptions Source #

Constructors

GravatarOptions 

Fields

Instances

Instances details
Default GravatarOptions Source # 
Instance details

Defined in Network.Gravatar

newtype Size Source #

Size in pixels

Constructors

Size Int 

data DefaultImg Source #

Image to show when an avatar is not available

Constructors

Custom String

supply your own url

NotFound

do not load an image return a 404

MM

mystery man

Identicon

geometric pattern based on the hash

MonsterId

a generated monster

Wavatar

generated faces

Retro

generated, 8-bit arcade style pixelated face

newtype ForceDefault Source #

Always show the default image

Constructors

ForceDefault Bool 

data Rating Source #

Limit the returned images by rating

Constructors

G 
PG 
R 
X 

data Scheme Source #

Scheme to use for image URLs

Constructors

Http
http://
Https
https://
None
//

Instances

Instances details
Show Scheme Source # 
Instance details

Defined in Network.Gravatar

def :: Default a => a #

The default value for this type.

defaultConfig :: GravatarOptions Source #

Available for backwards compatability, using def is advised