gerbenjacobs / HabboAPI

A PHP wrapper for the (undocumented) Habbo API
MIT License
44 stars 10 forks source link
composer habbo habbo-api packagist php

Build status Latest Stable Version

HabboAPI

This PHP wrapper library is used to collect data from the undocumented Habbo API.
The project requires PHP 8.1 or higher and uses the Composer autoloader and PSR-4 standard.

Older versions for PHP 7.4 are available at Packagist.

See the example.php file on how you could use this library.

How to use it

  1. Add the Composer package to your project by running composer require gerbenjacobs/habbo-api
  2. On the page you want to use it add include 'vendor/autoload.php'
  3. Create a HabboParser and construct it with the Habbo domain extension "com", "com.br", "de" etc.
  4. Create a HabboAPI instance and inject the HabboParser in the constructor

Usage

    <?php
    // Include the Composer autoloader
    include 'vendor/autoload.php';

    // Shortcut for the FQN
    use HabboAPI\HabboAPI;
    use HabboAPI\HabboParser;

    // Create new Parser and API instance
    $habboParser = new HabboParser('com');
    $habboApi = new HabboAPI($habboParser);

    // Find the user 'koeientemmer' and get their ID
    $koeientemmer = $habboApi->getHabbo('koeientemmer')->getId();

    // Collect all the profile info
    $profile = $habboApi->getProfile($koeientemmer);

Changelog

Developer Installation

  1. Clone the project
  2. Run composer install
  3. Verify the installation by running vendor/bin/phpunit or opening the example.php page on a PHP server