#-- # 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 . #++ module Gravaty # Allowed sizes (in pixels) for images requests. Currently a range # from 1 to 2048 (included). ALLOWED_SIZES = (1...2048) # Allowed parameters names. Currently: avatar, callback, default, # force, format, pixelsize, rating, secure and type. ALLOWED_PARAMS = [:avatar, :callback, :default, :force, :format, :pixelsize, :rating, :secure, :type] # Allowed formats (extensions) for avatar requests. Currently: # jp(e)g, png and gif. AVATAR_FORMATS = %w(jpg jpeg png gif) # Currently allowed default builtin options. Currently: 404, mp, # identicon, monsterid,wavatar, retro, robohash and blank. DEFAULT_OPTIONS = %w(404 mp identicon monsterid wavatar retro robohash blank) # Allowed formats (extensions) for default own images. Currently: # jp(e)g, png and gif. IMAGES_FORMATS = %w(jpg jpeg png gif) # Allowed formats (extensions) for profile requests. Currently: json, # xml, php, vcf and qr. PROFILE_FORMATS = %w(json xml php vcf qr) # Formats allowing supplemental options for profile requests. # Currently json and qr. PROFILES = %w(json qr) # Allowed rating options. Currently: g, pg, r and x. RATING_OPTIONS = %w(g pg r x) # Possible XML-RPC API errors. RPC_ERRORS = [-7, -8, -9, -10, -11, -100] # Allowed XML-RPC API methods. RPC_METHODS = %w(grav.exists grav.addresses grav.userimages grav.saveData grav.saveUrl grav.useUserimage grav.removeImage grav.deleteUserimage grav.test) # Default test method for XML-RPC API. RPC_TEST_METHOD = 'grav.test' # Reference URI for XML-RPC API. RPC_URI = 'secure.gravatar.com' end