gravatar

Simple class to generate Gravatar URL from a email-address.

Лицензия

Лицензия

Группа

Группа

org.rjung.util
Идентификатор

Идентификатор

gravatar
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

gravatar
Simple class to generate Gravatar URL from a email-address.
Ссылка на сайт

Ссылка на сайт

http://rynr.github.io/gravatar
Система контроля версий

Система контроля версий

http://github.com/rynr/gravatar

Скачать gravatar

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.rjung.util/gravatar/ -->
<dependency>
    <groupId>org.rjung.util</groupId>
    <artifactId>gravatar</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.rjung.util/gravatar/
implementation 'org.rjung.util:gravatar:1.0'
// https://jarcasting.com/artifacts/org.rjung.util/gravatar/
implementation ("org.rjung.util:gravatar:1.0")
'org.rjung.util:gravatar:jar:1.0'
<dependency org="org.rjung.util" name="gravatar" rev="1.0">
  <artifact name="gravatar" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.rjung.util', module='gravatar', version='1.0')
)
libraryDependencies += "org.rjung.util" % "gravatar" % "1.0"
[org.rjung.util/gravatar "1.0"]

Зависимости

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.hamcrest : hamcrest-core jar 1.3

Модули Проекта

Данный проект не имеет модулей.

gravatar

Simple class to generate Gravatar URL for a email-address.

Usage:

import org.rjung.util.Gravatar;

class GravatarExample {
  public void main(String[] args) {
    System.out.println(Gravatar.forEmail("example@example.com").toUrl());
  }
}

There are other parameters you can set for the generation, like size, Default and Rating.
Default gives a alternative to the default gravatar-default-image, if no gravatar is defined.
To define a Rating or Default, add the information before you build the url using toUrl().
If you need a https-URL, you can also set the protocol via with(Protocol). There are three Protocol-definitions, HTTP provides a http://..-url, accordingly HTTPS provides the https://..-url. The default is NONE, the url now starts with ://.., a browser will choose the same protocol as currently used.

import org.rjung.util.Gravatar;
import org.rjung.util.gravatar.Default;
import org.rjung.util.gravatar.Protocol;
import org.rjung.util.gravatar.Rating;

class GravatarExample {
  public void main(String[] args) {
    System.out.println(
      Gravatar.forEmail("example@example.com")
          .with(Protocol.HTTPS)     // prepend https://
          .size(123)                // set the size to 123 pixel
          .defaultImage(Default.MM) // if not available show mystery man image
          .with(Rating.X)           // set rating to X
          .toUrl());
  }
}

Links:

Версии библиотеки

Версия
1.0
0.1