0.0
No commit activity in last 3 years
No release in over 3 years
Gravatar.com, mainly known for its avatar hosting. But users can store more than only an avatar at gravatar. This gem also allows you to easily access it all (accounts at other social networks, more photo's, the name of the user, saved websites, cryptocurrency accounts and more)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.2.0
 Project Readme

EasyGravatar

Gravatar.com, mainly known for its avatar hosting. But users can store more than only an avatar at gravatar.

This gem also allows you to easily access it all (accounts at other social networks, more photo's, the name of the user, saved websites, cryptocurrency accounts and more)

Gem Version

Installation

Add this line to your application's Gemfile:

gem 'easy_gravatar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install easy_gravatar

Usage

Creating an instance is easy:

user = EasyGravatar::Gravatar.new("foo@bar.com")

Or use the even shorter class Gravatar:

user = Gravatar.new("foo@bar.com")

After creating an instance you can get some basics fast using

user.full_name # => the full name of the user
user.avatar # => the avatar from the user, in the default gravatar width of 80 pixels
user.avatar(150) # => the avatar from the user, in with a width of 150 pixels

Feel free to contribute to the project and add your own "short getters".

All the available information is saved in a hash. Use user.hash to get the hash. As an alternative it is also possible to easily read from the hash.

user.get_value(:formattedName) # => also gives the full name
user.get_value(:currency, :bitcoin) # => gives the users bitcoin address

Contributing

  1. Fork it ( https://github.com/dennisvandehoef/easy_gravatar/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request