You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
296 B
Elixir
15 lines
296 B
Elixir
8 years ago
|
defmodule Asciinema.Gravatar do
|
||
|
|
||
|
def gravatar_url(email, opts \\ []) do
|
||
|
hash = email
|
||
|
|> String.downcase
|
||
|
|> Crypto.md5
|
||
|
|
||
|
size = Keyword.get(opts, :size, 128)
|
||
|
default = Keyword.get(opts, :default, "retro")
|
||
|
|
||
|
"//gravatar.com/avatar/#{hash}?s=#{size}&d=#{default}"
|
||
|
end
|
||
|
|
||
|
end
|