https://github.com/astares/pharo-gravatar
A simple Pharo wrapper for the Gravatar API
https://github.com/astares/pharo-gravatar
pharo
Last synced: 11 months ago
JSON representation
A simple Pharo wrapper for the Gravatar API
- Host: GitHub
- URL: https://github.com/astares/pharo-gravatar
- Owner: astares
- License: mit
- Created: 2020-05-21T12:11:22.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T01:24:32.000Z (over 3 years ago)
- Last Synced: 2025-06-23T18:50:45.604Z (12 months ago)
- Topics: pharo
- Language: Smalltalk
- Size: 57.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pharo-Gravatar
A simple Pharo wrapper for the Gravatar API
[](https://github.com/astares/Pharo-Gravatar/actions?query=workflow%3AUnit%20Tests)
[](https://codecov.io/gh/astares/Pharo-Gravatar/branch/main)
[](https://pharo.org/download)
[](https://pharo.org/download)
[](https://pharo.org/download)
[](https://pharo.org/download)
[](https://pharo.org/download)
## Quick start
```Smalltalk
Metacello new
repository: 'github://astares/Pharo-Gravatar:main/src';
baseline: 'Gravatar';
load
```
## Screnshot
### Windows

## Use in your own application
### Retrieving the image URL
Usually you display a Gravatar image within a web application. If you generate the HTML you will add an URL for the image. To get one you can use:
```Smalltalk
Gravatar imageURLFor: 'example@mail.com'
```
If you require a different size just evaluate:
```Smalltalk
Gravatar imageURLFor: 'example@mail.com' size: 32.
```
Retrieving and displaying an image
If you need the real image you can use Pharos Zinc components suite to get the image form over HTTP and open it on your Pharo desk:
```Smalltalk
|form|
form := ZnEasy getJpeg: (Gravatar imageURLFor: 'example@mail.com').
form asMorph openInWorld
```
## Internals
Gravatar is based on MD5 hashing an email address. To get the hashing just evaluate:
```Smalltalk
Gravatar hash: 'example@mail.com'
```
### Packages
Gravatar-Core - package with the core, contains anything you need in an own app
Gravatar-Core-Tests - package with the SUnit tests
### Testing
The package comes with unit tests tests in the package Gravatar-Core-Tests. Just use the SUnit TestRunner to run them.