|
|
[[!toc levels=2]]
|
|
|
|
|
|
# Libraries
|
|
|
|
|
|
If a library or plugin is not availble for your language or application, your best option at the moment is to use our [simple API](api). Don't worry though, it's really not that much work!
|
|
|
|
|
|
## C\#
|
|
|
|
|
|
<img src="dotnet_logo.png" width="179" height="75" align="right">
|
|
|
|
|
|
[Chris Forbes](http://www.ijw.co.nz/) is maintaining the [C# bindings](https://github.com/chrisforbes/libravatar-sharp).
|
|
|
|
|
|
using libravatarsharp;
|
|
|
var uri = AvatarUri.FromEmail( "someone@example.com" );
|
|
|
|
|
|
(!) The library does not support federation.
|
|
|
|
|
|
## Haskell
|
|
|
|
|
|
<img src="haskell_logo.png" width="128" height="87" align="right">
|
|
|
|
|
|
The [Libravatar](http://www.rel4tion.org/projects/libravatar/) library is maintained by fr33domlover and is available on [hackage](https://hackage.haskell.org/package/libravatar).
|
|
|
|
|
|
import Network.Libravatar
|
|
|
myUrl = avatarUrl (Right "http://example.com/id/john") True Nothing (Just 100)
|
|
|
|
|
|
## node.js
|
|
|
|
|
|
<img src="nodejs_logo.png" width="219" height="75" align="right">
|
|
|
|
|
|
There is a [Libravatar node.js module](https://npmjs.org/package/libravatar) that can be used in the following way:
|
|
|
|
|
|
var libravatar = require('libravatar');
|
|
|
libravatar.url(email='person@example.com', openid=null, { size: 96, default: 'mm' }, https=false,
|
|
|
function (error, avatar_url) {
|
|
|
console.log('<img src="' + avatar_url + '">');
|
|
|
});
|
|
|
|
|
|
You can also use the [ember-cli module](https://www.npmjs.com/package/ember-cli-libravatar).
|
|
|
|
|
|
## Perl
|
|
|
|
|
|
<img src="perl_logo.png" width="75" height="75" align="right">
|
|
|
|
|
|
The [Libravatar::URL](http://search.cpan.org/dist/Gravatar-URL/lib/Libravatar/URL.pm) module is part of the [Gravatar::URL](http://search.cpan.org/dist/Gravatar-URL/) package (<tt>libgravatar-url-perl</tt> in [Debian](http://packages.debian.org/search?keywords=libgravatar-url-perl) and [Ubuntu](https://launchpad.net/ubuntu/+source/libgravatar-url-perl)) since version 1.03.
|
|
|
|
|
|
use Libravatar::URL;
|
|
|
my $avatar_url = libravatar_url(email => 'person@example.org');
|
|
|
print '<img src="' . $avatar_url . '">';
|
|
|
|
|
|
As of version 1.04, you can also use OpenID URLs instead of email addresses:
|
|
|
|
|
|
my $avatar_url = libravatar_url(openid => 'https://example.com/id/person');
|
|
|
|
|
|
## PHP
|
|
|
|
|
|
<img src="php_logo.png" width="145" height="75" align="right">
|
|
|
|
|
|
[Melissa Draper](http://www.meldraweb.com/) maintains the [Services_Libravatar](http://pear.php.net/package/Services_Libravatar/) PEAR package. Here's an example of how it works:
|
|
|
|
|
|
require_once 'Services/Libravatar.php';
|
|
|
$libravatar = new Services_Libravatar();
|
|
|
$avatar_url = $libravatar->getUrl('person@example.org');
|
|
|
print '<img src="' . htmlspecialchars($avatar_url) . '" alt="avatar"/>';
|
|
|
|
|
|
or like this for OpenID-based avatars served over HTTPS:
|
|
|
|
|
|
$avatar_url = $libravatar->getUrl('http://example.org/id/Person', array('https' => true));
|
|
|
|
|
|
## Python
|
|
|
|
|
|
<img src="python_logo.png" width="75" height="75" align="right">
|
|
|
|
|
|
The [pyLibravatar](http://pypi.python.org/pypi/pyLibravatar) module can be used like this:
|
|
|
|
|
|
from libravatar import libravatar_url
|
|
|
avatar_url = libravatar_url(email = 'person@example.org')
|
|
|
print '<img src="' + avatar_url + '">'
|
|
|
|
|
|
## Qt5
|
|
|
|
|
|
The source code for [Rawatar](http://pusling.com/blog/?p=329) can be found on [git.kde.org](http://quickgit.kde.org/?p=scratch%2Fsune%2Frawatar.git)
|
|
|
|
|
|
|
|
|
## Ruby
|
|
|
|
|
|
<img src="ruby_logo.png" width="75" height="75" align="right">
|
|
|
|
|
|
[Kang-min Liu](http://gugod.org) has created a [Libravatar Ruby gem](http://rubygems.org/gems/libravatar).
|
|
|
|
|
|
require 'libravatar'
|
|
|
avatar_url = Libravatar.new(:email => 'person@example.org')
|
|
|
print '<img src="', avatar_url, '">'
|
|
|
|
|
|
You can also use <tt>:openid => 'https://example.com/id/person'</tt> instead of providing an email address.
|
|
|
|
|
|
## Twisted
|
|
|
|
|
|
<img src="twisted_logo.png" width="71" height="75" align="right">
|
|
|
|
|
|
The [txLibravatar](http://pypi.python.org/pypi/txLibravatar) module can be used like this:
|
|
|
|
|
|
from txlibravatar import libravatar_url
|
|
|
d = libravatar_url(email = 'person@example.com')
|
|
|
d.addCallback(lambda x: print '<img src="' + x + '">')
|
|
|
|
|
|
## Go
|
|
|
|
|
|
<img src="https://blog.golang.org/gopher/gopher.png" width="71" align="right">
|
|
|
|
|
|
The [go-libravatar](https://strk.kbt.io/projects/go/libravatar) module can be used like this:
|
|
|
|
|
|
import "strk.kbt.io/projects/go/libravatar"
|
|
|
avt := libravatar.New()
|
|
|
avatar_url := avt.FromEmail("person@example.com")
|
|
|
|
|
|
or, with global context
|
|
|
|
|
|
avatar_url := libravatar.FromEmail("person@example.com")
|
|
|
|
|
|
|
|
|
<a name="plugins"></a>
|
|
|
# Plugins
|
|
|
|
|
|
There aren't many plugins available at the moment, but please [suggest the ones](suggested plugins) you'd like to have.
|
|
|
|
|
|
* [Claws Mail](http://www.claws-mail.org/plugin.php?plugin=libravatar) (since version 3.10)
|
|
|
* [Dotclear](https://open-time.net/post/2018/01/23/Plugin-Gravatars-08-pour-Dotclear)
|
|
|
* [Foswiki](http://foswiki.org/Extensions/AvatarPlugin)
|
|
|
* [Friendica](https://github.com/friendica/friendica-addons/tree/master/libravatar)
|
|
|
* [GNOME-shell-extension-timezone](https://github.com/jwendell/gnome-shell-extension-timezone)
|
|
|
* [GNU social](https://github.com/chimo/gs-libravatar)
|
|
|
* [Ikiwiki](http://ikiwiki.info) (part of core, automatically enabled if [Libravatar::URL](http://search.cpan.org/dist/Gravatar-URL/) is installed)
|
|
|
* [KDE PIM](https://community.kde.org/KDE_PIM) (part of core)
|
|
|
* [Koha](http://www.koha-community.org) (part of core starting in 3.6, automatically enabled if [Libravatar::URL](http://search.cpan.org/dist/Gravatar-URL/) is installed)
|
|
|
* [MediaWiki](http://www.mediawiki.org/wiki/Extension:Libravatar)
|
|
|
* [Mojolicious](https://metacpan.org/release/Mojolicious-Plugin-Libravatar)
|
|
|
* [Pidgin](https://code.google.com/p/pidgin-libravatar/)
|
|
|
* [Symfony](https://github.com/julienfastre/LibravatarBundle)
|
|
|
* [Toc Messenger](https://github.com/lewisl9029/toc) (part of core)
|
|
|
* [Trac](https://pypi.python.org/pypi/tracvatar/)
|
|
|
* [Weblate](http://weblate.org/) (part of core starting in 1.5)
|
|
|
* Wordpress: [Libravatar](http://wordpress.org/extend/plugins/libravatar/) and [Libravatar Replace](http://wordpress.org/plugins/libravatar-replace/)
|
|
|
* [Zookeepr](http://zookeepr.org/) (part of core, starting with PyCon AU 2012)
|
|
|
|
|
|
# Contribute!
|
|
|
|
|
|
Interested in writing a plugin for your favourite framework/CMS or a library for your favourite language? Please [get in touch](contact), we would be more than happy to link to them from this page! |