SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
Ruby gravaty gem
Marco Bresciani
What is gravaty?
● As described in the RubyGems page:
– 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
2014-04-30, starting from a single email address!
● Some (hopefully useful) references:
– https://rubygems.org/gems/gravaty
– https://savannah.nongnu.org/projects/gravaty
– Bugs: https://savannah.nongnu.org/bugs/?group=gravaty
What is Gravatar?
● According to Gravatar.Com (retrieved on 2014-05-19):
– An "avatar" is an image that represents you online—a little picture that appears next
to your name when you interact with websites.
– A Gravatar is a Globally Recognized Avatar. You upload it and create your profile
just once, and then when you participate in any Gravatar-enabled site, your
Gravatar image will automatically follow you there.
– Gravatar is a free service for site owners, developers, and users. It is automatically
included in every WordPress.com account and is run and supported by Automattic.
● According to Wikipedia (updated on 17 April 2014 at 10:22):
– Gravatar (an abbreviation for globally recognized avatar) is a service for providing
globally unique avatars which was created by Tom Preston-Werner. Since 2007, it
has been owned by Automattic, who have integrated it into their WordPress
blogging platform.
(see http://en.wikipedia.org/wiki/Gravatar)
How to create a gravaty object
● Create the Gravaty object. The gravatize factory method
needs your email address as parameter. There is no need to
register on Gravatar.Com:
– Gravaty::gravatize yourem@il.address
● Returns your email address MD5 digest:
– a_gravaty.digest
● to_s method is also available;
● Bonus feature: every Gravaty is a Comparable object,
based on a_gravaty.email data, your email address in
small capital letters.
The avatar image feature
● With your Gravaty object available, the avatar method provides
the configuration-specific URI for your avatar:
– a_gravaty.avatar returns
https://secure.avatar.com/avatar/HASH
(where HASH is your a_gravaty.digest email address MD5
digest)
● The method allows an Hash, with avatar configuration parameters:
type, pixel_size, force, secure, rating, default.
(see https://en.gravatar.com/site/implement/images/ for details)
● The avatar! method saves the provided configuration for your
Gravaty object's to_s output.
The profile content feature
● With your Gravaty object available, the profile method provides
the configuration-specific URI for your (registered) user:
– a_gravaty.profile returns
https://secure.avatar.com/HASH
(where HASH is your a_gravaty.digest email address MD5
digest)
● The method allows an Hash, with profile configuration parameters:
format, secure.
(see https://en.gravatar.com/site/implement/profiles/ for details)
● The profile! method saves the provided configuration for your
Gravaty object's to_s output.
The XML-RPC API content feature
● With your Gravaty object available, the xmlrpc method provides
a reference to the remote Gravatar XML-RPC AP, for your
(registered) user:
– a_gravaty.xmlrpc requires the method name (grav.test,
by default), your password and possible method parameters
(whether needed) via a Hash.
● In order to increase security, the password is not saved inside the
Gravaty object but has to be provided for each call;
(see https://en.gravatar.com/site/implement/xmlrpc/ for details)
● Communication happens through SSL: certificate might be
required (see gravaty README.md file).
Additional features (1/2)
● Since QRCode and JSON are becoming popular formats, qr and
json methods (together with qr! and json!) allows to directly
retrieve the user's profile data URI, in QRCode or JSON format, with
format-specific parameters. Examples:
– a_gravaty.qr pixel_size: 42
– a_gravaty.json! callback: 'my_method'
● The qr! and json! methods save the provided configuration for your
Gravaty object's to_s output.
● a_gravaty.qr corresponds to a_gravaty.profile format:
'qr' while a_gravaty.json corresponds to a_gravaty.profile
format: 'json' and they both filtered the allowed parameters
according to the output type.
Additional features (2/2)
● When using the 'banged' (!) methods (avatar! or profile!,
same for qr! and json!), the built URI is saved inside the
Gravaty object and is read-only available through to_s.
● The download method, simply specifying a filename as
parameter, retrieves whatever resource is indicate by such
internal status and saves its content in the specified file.
Example:
– a_gravaty.qr!
– a_gravaty.download 'myQr.png'
● The reset method clears the internal status restoring the email
address output of to_s.
Ruby gravaty gem
● This work is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International License. To view a
copy of this license, visit
http://creativecommons.org/licenses/by-sa/4.0/.
● Ruby gravaty gem by Marco Bresciani is licensed under a
Creative Commons Attribution-ShareAlike 4.0 International
License.
● Some (hopefully useful) references:
– https://rubygems.org/gems/gravaty
– https://savannah.nongnu.org/projects/gravaty

Más contenido relacionado

Similar a Ruby gravaty gem

Freeing the cloud, one service at a time
Freeing the cloud, one service at a timeFreeing the cloud, one service at a time
Freeing the cloud, one service at a timeFrancois Marier
 
Will paginate and kaminari
Will paginate and kaminariWill paginate and kaminari
Will paginate and kaminariKuyseng Chhoeun
 
Build Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyBuild Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyImran Sayed
 
Latest & interesting updates #android dev
Latest & interesting updates #android devLatest & interesting updates #android dev
Latest & interesting updates #android devParesh Mayani
 
IRJET- Login System for Web: Session Management using BCRYPTJS
IRJET- Login System for Web: Session Management using BCRYPTJSIRJET- Login System for Web: Session Management using BCRYPTJS
IRJET- Login System for Web: Session Management using BCRYPTJSIRJET Journal
 
BloodHound Unleashed.pdf
BloodHound Unleashed.pdfBloodHound Unleashed.pdf
BloodHound Unleashed.pdfn00py1
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsPhilip Stehlik
 
Open Source Web Charts
Open Source Web ChartsOpen Source Web Charts
Open Source Web ChartsHaNJiN Lee
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraStoyan Zhekov
 
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Esteve Castells
 
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...Woptimo
 
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generatorsDEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generatorsFelipe Prado
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the CloudChristoffer Noring
 
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesomeEuroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesomeMetosin Oy
 
Javascript SEO - Leicester Digital May 2018
Javascript SEO - Leicester Digital May 2018Javascript SEO - Leicester Digital May 2018
Javascript SEO - Leicester Digital May 2018Kieran Headley
 
Rails training presentation routing
Rails training presentation   routingRails training presentation   routing
Rails training presentation routingtheacadian
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Henry S
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hourshanhvi
 
Building A Gem From Scratch
Building A Gem From ScratchBuilding A Gem From Scratch
Building A Gem From ScratchBrian Hogan
 

Similar a Ruby gravaty gem (20)

Freeing the cloud, one service at a time
Freeing the cloud, one service at a timeFreeing the cloud, one service at a time
Freeing the cloud, one service at a time
 
Will paginate and kaminari
Will paginate and kaminariWill paginate and kaminari
Will paginate and kaminari
 
Build Fast WordPress Site With Gatsby
Build Fast WordPress Site With GatsbyBuild Fast WordPress Site With Gatsby
Build Fast WordPress Site With Gatsby
 
Latest & interesting updates #android dev
Latest & interesting updates #android devLatest & interesting updates #android dev
Latest & interesting updates #android dev
 
IRJET- Login System for Web: Session Management using BCRYPTJS
IRJET- Login System for Web: Session Management using BCRYPTJSIRJET- Login System for Web: Session Management using BCRYPTJS
IRJET- Login System for Web: Session Management using BCRYPTJS
 
BloodHound Unleashed.pdf
BloodHound Unleashed.pdfBloodHound Unleashed.pdf
BloodHound Unleashed.pdf
 
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James WilliamsSF Grails - Ratpack - Compact Groovy Webapps - James Williams
SF Grails - Ratpack - Compact Groovy Webapps - James Williams
 
Open Source Web Charts
Open Source Web ChartsOpen Source Web Charts
Open Source Web Charts
 
Schema Markup
Schema MarkupSchema Markup
Schema Markup
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
Advanced Web Scraping or How To Make Internet Your Database #seoplus2018
 
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...
Universal Analytics and SEO: How to improve your SEM strategy with Analytics'...
 
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generatorsDEF CON 27 - BEN SADEGHIPOUR  - owning the clout through ssrf and pdf generators
DEF CON 27 - BEN SADEGHIPOUR - owning the clout through ssrf and pdf generators
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
 
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesomeEuroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
Euroclojure2014: Schema & Swagger - making your Clojure web APIs more awesome
 
Javascript SEO - Leicester Digital May 2018
Javascript SEO - Leicester Digital May 2018Javascript SEO - Leicester Digital May 2018
Javascript SEO - Leicester Digital May 2018
 
Rails training presentation routing
Rails training presentation   routingRails training presentation   routing
Rails training presentation routing
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
 
Shindig in 2 hours
Shindig in 2 hoursShindig in 2 hours
Shindig in 2 hours
 
Building A Gem From Scratch
Building A Gem From ScratchBuilding A Gem From Scratch
Building A Gem From Scratch
 

Último

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Último (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Ruby gravaty gem

  • 2. What is gravaty? ● As described in the RubyGems page: – 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 2014-04-30, starting from a single email address! ● Some (hopefully useful) references: – https://rubygems.org/gems/gravaty – https://savannah.nongnu.org/projects/gravaty – Bugs: https://savannah.nongnu.org/bugs/?group=gravaty
  • 3. What is Gravatar? ● According to Gravatar.Com (retrieved on 2014-05-19): – An "avatar" is an image that represents you online—a little picture that appears next to your name when you interact with websites. – A Gravatar is a Globally Recognized Avatar. You upload it and create your profile just once, and then when you participate in any Gravatar-enabled site, your Gravatar image will automatically follow you there. – Gravatar is a free service for site owners, developers, and users. It is automatically included in every WordPress.com account and is run and supported by Automattic. ● According to Wikipedia (updated on 17 April 2014 at 10:22): – Gravatar (an abbreviation for globally recognized avatar) is a service for providing globally unique avatars which was created by Tom Preston-Werner. Since 2007, it has been owned by Automattic, who have integrated it into their WordPress blogging platform. (see http://en.wikipedia.org/wiki/Gravatar)
  • 4. How to create a gravaty object ● Create the Gravaty object. The gravatize factory method needs your email address as parameter. There is no need to register on Gravatar.Com: – Gravaty::gravatize yourem@il.address ● Returns your email address MD5 digest: – a_gravaty.digest ● to_s method is also available; ● Bonus feature: every Gravaty is a Comparable object, based on a_gravaty.email data, your email address in small capital letters.
  • 5. The avatar image feature ● With your Gravaty object available, the avatar method provides the configuration-specific URI for your avatar: – a_gravaty.avatar returns https://secure.avatar.com/avatar/HASH (where HASH is your a_gravaty.digest email address MD5 digest) ● The method allows an Hash, with avatar configuration parameters: type, pixel_size, force, secure, rating, default. (see https://en.gravatar.com/site/implement/images/ for details) ● The avatar! method saves the provided configuration for your Gravaty object's to_s output.
  • 6. The profile content feature ● With your Gravaty object available, the profile method provides the configuration-specific URI for your (registered) user: – a_gravaty.profile returns https://secure.avatar.com/HASH (where HASH is your a_gravaty.digest email address MD5 digest) ● The method allows an Hash, with profile configuration parameters: format, secure. (see https://en.gravatar.com/site/implement/profiles/ for details) ● The profile! method saves the provided configuration for your Gravaty object's to_s output.
  • 7. The XML-RPC API content feature ● With your Gravaty object available, the xmlrpc method provides a reference to the remote Gravatar XML-RPC AP, for your (registered) user: – a_gravaty.xmlrpc requires the method name (grav.test, by default), your password and possible method parameters (whether needed) via a Hash. ● In order to increase security, the password is not saved inside the Gravaty object but has to be provided for each call; (see https://en.gravatar.com/site/implement/xmlrpc/ for details) ● Communication happens through SSL: certificate might be required (see gravaty README.md file).
  • 8. Additional features (1/2) ● Since QRCode and JSON are becoming popular formats, qr and json methods (together with qr! and json!) allows to directly retrieve the user's profile data URI, in QRCode or JSON format, with format-specific parameters. Examples: – a_gravaty.qr pixel_size: 42 – a_gravaty.json! callback: 'my_method' ● The qr! and json! methods save the provided configuration for your Gravaty object's to_s output. ● a_gravaty.qr corresponds to a_gravaty.profile format: 'qr' while a_gravaty.json corresponds to a_gravaty.profile format: 'json' and they both filtered the allowed parameters according to the output type.
  • 9. Additional features (2/2) ● When using the 'banged' (!) methods (avatar! or profile!, same for qr! and json!), the built URI is saved inside the Gravaty object and is read-only available through to_s. ● The download method, simply specifying a filename as parameter, retrieves whatever resource is indicate by such internal status and saves its content in the specified file. Example: – a_gravaty.qr! – a_gravaty.download 'myQr.png' ● The reset method clears the internal status restoring the email address output of to_s.
  • 10. Ruby gravaty gem ● This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/. ● Ruby gravaty gem by Marco Bresciani is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. ● Some (hopefully useful) references: – https://rubygems.org/gems/gravaty – https://savannah.nongnu.org/projects/gravaty