Belirli bir e-posta Gravatar görüntünün bir url oluşturmak nasıl

3 Cevap php

php ile basit bir şekilde, gravatar görüntü bir e-postaya gelen bir URL oluşturmak için basit bir script veya URL manipülasyon var?

Ex. http://gravatar.com/avatars/avatar.php?email=myemail@myserver.com ve bu bir jpeg veya png resim döndürür.

Basit bir yolu örnekte olduğu gibi varsa, bir e-postaya gelen Gravatar bir url çözmek için bilmeniz kolay yolu nedir?. Teşekkürler

3 Cevap

Sen bunların uygulanması sitesinde PHP kodu ile bir örnek komut bulabilirsiniz: http://en.gravatar.com/site/implement/php

The root script is at http://www.gravatar.com/avatar/ The next part of the URL is the hexadecimal MD5 hash of the requested user's lowercased email address with all whitespace trimmed. You may add the proper file extension, but it's optional.

Tam bir API burada http://en.gravatar.com/site/implement/

Bunu kullanın:

$userMail = whatever_to_get_the_email;

$imageWidth = '150'; //The image size

$imgUrl = 'http://www.gravatar.com/avatar/'.md5($userMail).'fs='.$imageWidth;