mirror of
https://codeberg.org/vlw/labylib-chattycape.git
synced 2025-09-14 00:23:41 +02:00
Release 1.0.0 Added default texture render backend inside 'backend/' Removed some debugging states from 'start.py' Tags can now use the full cape size for more flexibility. Updated tag textures for 'us.mineplex.com' to support this.
27 lines
No EOL
685 B
PHP
27 lines
No EOL
685 B
PHP
<?php
|
|
|
|
// Get Minotar from API
|
|
class Minotar {
|
|
|
|
public function __construct($username,$size) {
|
|
$this->url = "https://minotar.net/armor/bust/{$username}/{$size}.png";
|
|
|
|
$this->data = $this->curl();
|
|
$this->image = imagecreatefromstring($this->data);
|
|
$this->size = [imagesx($this->image),imagesy($this->image)];
|
|
}
|
|
|
|
private function curl() {
|
|
$curl = curl_init();
|
|
|
|
curl_setopt($curl, CURLOPT_URL, $this->url);
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // good edit, thanks!
|
|
curl_setopt($curl, CURLOPT_BINARYTRANSFER, 1); // also, this seems wise considering output is image.
|
|
|
|
$data = curl_exec($curl);
|
|
curl_close($curl);
|
|
|
|
return $data;
|
|
}
|
|
|
|
} |