# Gravaty ![Gem](https://img.shields.io/gem/v/gravaty.svg?style=plastic) ![Gem](https://img.shields.io/gem/dt/gravaty.svg?style=plastic) ![Gem](https://img.shields.io/gem/dtv/gravaty.svg?style=plastic) ![Gem download rank](https://img.shields.io/gem/rt/gravaty.svg?style=plastic) ![Gem download rank (daily)](https://img.shields.io/gem/rd/gravaty.svg?style=plastic) ![Dependent repos (via libraries.io)](https://img.shields.io/librariesio/dependent-repos/rubygems/gravaty.svg?style=plastic) Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani This file is part of gravaty. gravaty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. gravaty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with gravaty. If not, see . ## Description This gem automagically prepares complete URIs for Gravatar, for both avatars and profiles, with all currently supported options, included the XML-RPC API, as of 2019-04-23, starting from a single email address! It's my first 'real' Ruby gem, hoping it will be useful for someone (let me know if you use it, please!). GNU GPLv3 license; source code available through anonymous checkout: `hg clone http://hg.savannah.nongnu.org/hgweb/gravaty/` or write me and I'll send it. You can even decide to contribute to this little free software project by registering to Savannah and ask to be part of the 'gravaty' project! With contributions from: 新部裕, Peter R. Marreck, Jon Maken, Łukasz Niemier. ## Documentation Gravaty tries to follow semantic versioning (see ). There may be backward incompatible changes each time minor version number changes, but that any tiny version number change should be bug fixes and internal changes only. Be sure to read the CHANGELOG each time we cut a new release and lock your gems accordingly. RDoc documentation available in the html folder. ### Installing Gravaty RubyGems is the preferred easy install method for Gravaty. Gravaty is intended to be installed via the [RubyGems](http://rubyforge.org/projects/rubygems/) system. To get the latest version, simply enter the following into your command prompt: `gem install gravaty`. *NOTE*: for both examples and tests, you may need to set a SSL certificate file. In Microsoft Windows environment, the easiest way is as described by the downloader gist. You have to download the certificates from (for example) and, for example, put the cacert.pem file in the gravaty home directory. Then `set SSL_CERT_FILE=`{FULL_PATH}`\cacert.pem` and finally try to run `ruby avatar.rb` or `ruby profiles.rb` from the `examples` directory; both examples should download two files each! The same environment variable would be needed to run the tests against the XML-RPC API. ### Supported Ruby Versions and Implementations Because Gravaty is pure Ruby, it should run pretty much anywhere, including Rubinius, JRuby, MacRuby, etc. Officially the support is for \>= 2.6 YARV/KRI. ### Support The easiest way to get help with Gravaty is to post a message to the mailing list: `http://lists.nongnu.org/mailman/listinfo/gravaty-users`. Feel free to post any question there, developers are responsive and will be happy to help you figure out how to use Gravaty, or help you determine whether it's the right tool for the task you are working on. Please make your posts to the list as specific as possible, including code samples and output where relevant. Do not post any information that should not be shared publicly, and be sure to reduce your example code as much as possible so that those who are responding to your question can more easily see what the issue might be. ### Contributing If you've found a bug, want to submit a patch, or have a feature request, please enter a ticket into our bug tracker: `https://savannah.nongnu.org/bugs/?func=additem&group=gravaty`. We strongly encourage bug reports to come with failing tests or at least a reduced example that demonstrates the problem. Similarly, patches should include tests, API documentation, and an update to the manual where relevant. Feel free to clone early though and participate in the project, if you just want some feedback or a code review before preparing your code to be merged. If you are unsure about whether or not you've found a bug, or want to check to see whether we'd be interested in the feature you want to add before you start working on it, feel free to post to our mailing list. ### License Gravaty is released under GNU GPL v3 license: if you wish to contribute to Gravaty, you will retain your own copyright but must agree to license your code under the same terms as the project itself (or any compatible license according to [GPL-Compatible Free Software Licenses](http://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses)). ### Links #### Savannah * Project page: * Source code (Mercurial) repository: * Known Bugs: * Users Mailing List: * News: #### RubyGems * Gem page: * Online RDoc: * Gem updates Atom Feed: #### Other links * Gravatar: . * FSIJ (フリーソフトウェアイニシアティブ, Free Software Initiative of Japan): . * "RFC 5322 Email Validation Regex in Ruby Regular Expressions" gist by Peter R. Marreck: . * "An HTTP/HTTPS/FTP file downloader library/CLI based upon MiniPortile's HTTP implementation." gist by Jon Maken: . ### Usage Examples See `examples` folder. To run the examples just type go into the `examples` directory and run `ruby `{EXAMPLE_NAME}`.rb`. Running the examples you'll see both the example description and correct code usage to perform such action. Here below are listed the currently available examples: * The `basics.rb` example (run `ruby basics.rb`) shows how to initialize and use a Gravaty object through the `gravatize` factory method; * The `avatar.rb` example (run `ruby avatar.rb`) shows how to ask for an avatar image through Gravatar (free) service, with all available options and configurations. It will also show how to download such images; * The `profile.rb` example (run `ruby profile.rb`) shows how to ask for profile data through Gravatar (free) service, with all available options and configurations. It will also show how to download such data. * The `xmlrpc.rb` example (run `ruby xmlrpc.rb`) shows how to use the XML-RPC API through Gravatar (free) service, with all available options and configurations. This need a valid username and password to type x work properly. ## Gravatar Terms of Service *Here follows the unmodified 2019-02-21 11.07 CET version of Gravatar site terms of service, titled "Gravatar Terms of Use". For the most updated version, please refer to https://secure.gravatar.com/site/terms-of-service in order to know how to properly use computer gravatars.* Gravatar Terms of Use PLEASE READ THESE GRAVATAR TERMS OF USE ("GRAVATAR TERMS") CAREFULLY BEFORE ACCESSING OR USING ANY PART OF THE SERVICES OR WEBSITE. BY USING THE SERVICES OR WEBSITE IN ANY MANNER, YOU AGREE THAT YOU HAVE READ AND AGREE TO BECOME BOUND BY THE GRAVATAR TERMS. IF THE GRAVATAR TERMS ARE CONSIDERED AN OFFER, ACCEPTANCE IS EXPRESSLY LIMITED TO SUCH TERMS. IF YOU DO NOT UNCONDITIONALLY AGREE TO ALL THE TERMS AND CONDITIONS OF THE GRAVATAR TERMS, YOU HAVE NO RIGHT TO USE ANY PORTION OF THE SERVICES OR WEBSITE. The Gravatar Terms govern the terms and conditions under which you may use the website located at www.gravatar.com and related services by Automattic, including without limitation, the user accounts, profiles, avatars, technology, and other content and materials offered on or through that website (collectively, "Services", and each of which shall be deemed a "Website" for purposes of the Terms of Service (defined below)). The Gravatar Terms supplement the Terms of Service located at http://wordpress.com/tos/ (the "Terms of Service"), including without limitation, the Responsibilities of Website Visitors, all warranty disclaimers, limitations of liability, and dispute resolution provisions therein, which shall apply to the subject matter of these Gravatar Terms, and which are incorporated herein by this reference. If there is any conflict between the Gravatar Terms and the Terms of Service, the Gravatar Terms will govern. All capitalized terms that are not defined herein have the meaning specified in the Terms of Service.'); Automattic may update the Gravatar Terms from time to time. Your continued use of the Services following notification of such updates constitutes your acceptance of those changes. 1. User Submissions. The Services may provide you with the ability to create, upload, distribute or post ("Submit(ting)") data, photographs, avatars, software, graphics, profile and other information to the Services (collectively, the "User Submissions"). By Submitting User Submissions, you acknowledge that you are publishing that User Submission, and that you may be identified publicly by your avatar and other User Submissions (e.g., in connection with your blogs, comments and/or email address) by Automattic, third party Gravatar-enabled websites (as that term in defined below), and others. More specifically, you hereby do and shall grant to Automattic a worldwide, perpetual, irrevocable, royalty-free and fully-paid, transferable (including rights to sublicense) right to perform the Services (e.g., to use, modify, reproduce, distribute, prepare derivative works of, display, perform, and otherwise fully exercise and exploit all intellectual property, publicity, and moral rights with respect to any User Submissions, and to allow others to do so). By Submitting, you agree to be solely responsible for the User Submissions and release Automattic from any liability related to your use of the Services. You warrant, represent and agree that you will not Submit any User Submissions or otherwise use the Services in a manner that (i) infringes the intellectual property or proprietary rights, or rights of publicity or privacy, of any third party; (ii) violates any law, statute, ordinance or regulation; or (iii) is harmful, threatening, abusive, harassing, tortuous, defamatory, vulgar, obscene, libelous, or otherwise objectionable. You understand that Automattic shall not be responsible or liable for controlling or editing any User Submission, for any errors or omissions in any User Submission, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any User Submission; nor can Automattic ensure prompt removal of inappropriate or unlawful content or guarantee the identity of any other users or websites with whom you may interact in the course of using the Services. 2. Use of the Services by Third Party Websites. Third party websites may enable the use of the Services on their respective websites as expressly authorized by Automattic (e.g., API calls into Gravatar: http://en.gravatar.com/site/implement); provided that they (i) do not copy, store or modify User Submissions; (ii) do not distribute, display, perform, use or otherwise exercise or exploit any User Submission or other user information for any purpose other than as necessary to perform the Services for the applicable user; (iii) have a privacy policy in effect and posted on such website that complies with all applicable laws and regulations and that notifies such user that it will only use personally identifiable information as set forth in (ii) above; and (iv) agree to be bound by and comply with all the terms, conditions, and limitations set forth in the Terms of Service ("Gravatar-enabled website"). ------------------------------------------ gravaty Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani This file is part of gravaty. gravaty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. gravaty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with gravaty. If not, see .