How should i check if gravatar exist?

gravatar, ruby-on-rails

Solution

Looking at that gem's documentation, it sounds like you need an API key before you can run the exists method:

Fine, but how about the rest of the API as advertised at en.gravatar.com/site/implement/xmlrpc? Well, for that you need either the user’s Gravatar password, or their API key:

api = Gravatar.new("generic@example.com", :api_key => "AbCdEfG1234")

api.exists?("another@example.com") #=> true or false, depending on whether the specified email exists.

If the user doesn't have a gravatar, an image will be generated for them based on the email (at least that has been my experience). I've used the gem gravatar_image_tag - http://rubygems.org/gems/gravatar_image_tag which lets you change the default gravatar image.

Problem

using this gem https://github.com/sinisterchipmunk/gravatar how do i check if gravatar for specified email exist or not? I think i am missing some force default option? Because this ``` url = Gravatar.new("generic@example.com").image_url ``` always return a picture

Original source

Related problems