#-- # gravaty # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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 . #++ require_relative '../lib/gravaty' i = 0 # Creates the Gravaty object with an (example) email puts "------------------------------------------" puts "Profile: '#{i}'. Creates the Gravaty object with an (example) email." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty = Gravaty::gravatize 'user@example.com'" a_gravaty = Gravaty::gravatize 'user@example.com' puts i += 1 # Prints the basic URL for profile retrieval, with no frills # (https://www.gravatar.com/b58996c504c5638798eb6b511e6f49af) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, with no frills (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af)." puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.profile' puts a_gravaty.profile puts i += 1 # Prints the basic URL for profile retrieval, with no frills, in json # format through json-specific method # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.json) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, with no frills, in json format through json-specific method (http://www.gravatar.com/b58996c504c5638798eb6b511e6f49af.json)." puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.json' puts a_gravaty.json puts i += 1 # Prints the basic URL for profile retrieval, in JSON format, with # callback string # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.json?callback=my_callback) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, in JSON format, with callback string (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.json?callback=my_callback)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.json callback: 'my_callback'" puts a_gravaty.json callback: 'my_callback' puts i += 1 # Prints the basic URL for profile retrieval, in PHP format # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.php) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, in PHP format (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.php)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.profile format: 'php'" puts a_gravaty.profile format: 'php' puts i += 1 # Prints the basic URL for profile retrieval, with no frills, in QR code # format through QR code-specific method # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, with no frills, in QR code format through QR code-specific method (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr)." puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.qrcode' puts a_gravaty.qrcode puts i += 1 # Prints and saves the basic URL for profile retrieval, with no frills, # in QR code format # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr) puts "------------------------------------------" puts "Profile: '#{i}'. Prints and saves the basic URL for profile retrieval, with no frills, in QR code format (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.profile! format: 'qr'" puts a_gravaty.profile! format: 'qr' puts i += 1 # Retrieves the latest saved operation (email address, if none saved) # (user@example.com) puts "------------------------------------------" puts "Profile: '#{i}'. Retrieves the latest saved operation (email address, if none saved) (user@example.com)." puts "------------------------------------------" puts 'irb(main):001:0> puts a_gravaty' puts a_gravaty puts i += 1 # Prints and save the basic URL for profile and later retrieval, in QR # code format # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr) puts "------------------------------------------" puts "Profile: '#{i}'. Prints and save the basic URL for profile and later retrieval, in QR code format (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.profile! format: 'qr'" puts a_gravaty.profile! format: 'qr' puts # Downloads the previously saved gravaty configuration with the default # name of the file according to saved URI # (saves b58996c504c5638798eb6b511e6f49af.qr file via HTTPS) puts "------------------------------------------" puts "Profile: '#{i}'. Downloads the previously saved gravaty configuration with the default name of the file according to saved URI. (saves b58996c504c5638798eb6b511e6f49af.qr file via HTTPS)" puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.download' a_gravaty.download puts i += 1 # Prints the basic URL for profile retrieval in QR code format # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr) puts "------------------------------------------" puts "Profile: '#{i}'a. Prints the basic URL for profile retrieval in QR code format (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr)." puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.qrcode' puts a_gravaty.qrcode puts # Prints the unsecure URL for profile retrieval in QR code format with # specified image size (in pixels) # (http://www.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr?s=42) puts "------------------------------------------" puts "Profile: '#{i}'b. prints the unsecure URL for profile retrieval in QR code format with specified image size (in pixels) (http://www.gravatar.com/b58996c504c5638798eb6b511e6f49af.qr?s=42)." puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.qrcode pixelsize: 42, secure: false' puts a_gravaty.qrcode! pixelsize: 42, secure: false puts i += 1 # Retrieves the latest saved operation (email address, if none saved) # (user@example.com) puts "------------------------------------------" puts "Profile: '#{i}'. Retrieves the latest saved operation (email address, if none saved) (user@example.com)." puts "------------------------------------------" puts 'irb(main):001:0> puts a_gravaty' puts a_gravaty puts i += 1 # Prints and saves the unsecure URL for profile retrieval, in VFC/vCard # format (http://www.gravatar.com/b58996c504c5638798eb6b511e6f49af.vcf) puts "------------------------------------------" puts "Profile: '#{i}'. Prints and saves the unsecure URL for profile retrieval, in VFC/vCard format (http://www.gravatar.com/b58996c504c5638798eb6b511e6f49af.vcf)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.profile format: 'vcf', secure: false" puts a_gravaty.profile! format: 'vcf', secure: false puts i += 1 # Downloads the previously saved gravaty configuration with the default # name of the file according to saved URI # (saves b58996c504c5638798eb6b511e6f49af.vcf file via HTTP) puts "------------------------------------------" puts "Profile: '#{i}'. Downloads the previously saved gravaty configuration with the default name of the file according to saved URI. (saves b58996c504c5638798eb6b511e6f49af.vcf file via HTTP)" puts "------------------------------------------" puts 'irb(main):001:0> a_gravaty.download' a_gravaty.download puts i += 1 # Prints the basic URL for profile retrieval, in XML format # (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.xml) puts "------------------------------------------" puts "Profile: '#{i}'. Prints the basic URL for profile retrieval, in XML format (https://secure.gravatar.com/b58996c504c5638798eb6b511e6f49af.xml)." puts "------------------------------------------" puts "irb(main):001:0> a_gravaty.profile format: 'xml'" puts a_gravaty.profile format: 'xml' puts