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

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 

Último (20)

SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 

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