Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astares/pharo-gravatar
A simple Pharo wrapper for the Gravatar API
https://github.com/astares/pharo-gravatar
pharo
Last synced: 6 days 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 (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T01:24:32.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T06:41:51.723Z (about 2 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[![Unit Tests](https://github.com/astares/Pharo-Gravatar/workflows/Unit%20Tests/badge.svg?branch=main)](https://github.com/astares/Pharo-Gravatar/actions?query=workflow%3AUnit%20Tests)
[![Coverage Status](https://codecov.io/github/astares/Pharo-Gravatar/coverage.svg?branch=main)](https://codecov.io/gh/astares/Pharo-Gravatar/branch/main)[![Pharo 7](https://img.shields.io/badge/Pharo-7.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 8](https://img.shields.io/badge/Pharo-8.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 9](https://img.shields.io/badge/Pharo-9.0-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-%23aac9ff.svg)](https://pharo.org/download)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-%23aac9ff.svg)](https://pharo.org/download)## Quick start
```Smalltalk
Metacello new
repository: 'github://astares/Pharo-Gravatar:main/src';
baseline: 'Gravatar';
load
```## Screnshot
### Windows
![alt text](doc/gravatar.png "Screenshot")## 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: '[email protected]'
```If you require a different size just evaluate:
```Smalltalk
Gravatar imageURLFor: '[email protected]' 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: '[email protected]').
form asMorph openInWorld
```## Internals
Gravatar is based on MD5 hashing an email address. To get the hashing just evaluate:
```Smalltalk
Gravatar hash: '[email protected]'
```### 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.