I want to put some icons in a web and I want to know how can I detect if a person has a gravatar so in case they don't have one I want to show another icon, can anyone help me?? Thanks in advance Belén
I tried a while ago to implement this and finished doing a column in the users table saying wants_gravatar:boolean. If it was true, then the user.face method would return their gravatar picture like so:
if wants_gravatar? "http://www.gravatar.com/avatar.php? gravatar_id=#{Digest::MD5.hexdigest(email_address)}" else self.avatar ? self.avatar.public_filename : DEFAULTFACE end
but actually checking wether the email address mapped any pictures in gravatar or not, i could not find a way. I decided that if the user wanted a gravatar an didnt have one, hed just get the gravatar logo. it was so much less painfull to implement.
It still appreciate if anyone knew how to perform the check.
j
seems there are two plugins available: http://en.gravatar.com/site/implement/rails
but none of them seems to implement any check, if a gravatar exists as far as I can see, the only thing possible is to set one of three default images: