Skip to content

aoshiftctrl/AvatarAPImg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AvatarAPImg

AvatarAPImg is a tiny PHP based API. It's your central avatar hub for selfhosted webapps. You can easily configure it with a json file.

Setup

Easily configure AvatarAPImg within the config.php

const URL = "https://avatar.yourdomain.tld/data/ego.json";

API-Key

Make your personal uuid with a sha1- or md5-hash

"API-Key": {
      "uuid" : "5085867adc42fc7d09297f018244d28a"
  }

API Properties

stdClass Object
(
    [avatar] => stdClass Object
        (
            [user] => Rej
            [src] => ./assets/ego.jpg
            [format] => jpg
            [width] => 250
            [height] => 250
            [title] => Rej
        )

    [API-Key] => stdClass Object
        (
            [uuid] => 5085867adc42fc7d09297f018244d28a
        )

)

API Call

$cUrl = curl_init();
curl_setopt_array($cUrl, array(
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_URL => 'https://avatar.yourdomain.tld/api.php'
));

$avatar = curl_exec($cUrl);

Simple Usage

<?= $avatar; ?>

Installation

Just copy the files to your server, using FTP. We recommend to use a subdomain for the API.

Requirments

PHP 5.5+, Apache or Nginx

Demo: avatar.cctrl.de

^Rej

made with ❤ by shiftctrl

About

AvatarAPImg is a tiny PHP based API. It's your central avatar hub for selfhosted webapps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages