Renyu106/MusicChart-API

โ˜… 0Forks 0PHPGitHub โ†—Compare

README

MusicChart-API

๐ŸŽต Introduction

Welcome to the MusicChart PHP Class! This class is designed to fetch music chart data from various platforms like VIBE, MELON, and BUGS. It's a simple and effective way to integrate music chart information into your PHP projects.

๐Ÿš€ Features

  • Supports multiple music platforms: VIBE, MELON, BUGS.
  • Easy to use with a straightforward constructor.
  • Secure data fetching with SSL support.
  • Error handling for different scenarios, including platform support and data parsing issues.

๐Ÿ›  Requirements

  • PHP environment with cURL support.
  • SSL certificates for secure connections (optional but recommended).

๐Ÿ“ฆ Installation

Simply include the MusicChaert class file in your PHP project. Make sure the PHP environment is set up with cURL support.

๐Ÿ“– How to Use

  1. Initialize the Class:

    $musicChart = new MusicChaert('PLATFORM_NAME'); // Replace 'PLATFORM_NAME' with 'VIBE', 'MELON', or 'BUGS'
  2. Fetch the Chart:

    $result = $musicChart->GET_CHAERT('DATE'); // 'DATE' is optional, format: 'YYYY-MM-DD'
  3. Process the Result:

    • The result will be an associative array containing status, message, and data.
    • Check the STATUS key to determine if the request was successful.

๐Ÿ” Example

$musicChart = new MusicChaert('VIBE');
$result = $musicChart->GET_CHAERT('2023-01-01');

if ($result['STATUS'] === 'OK') {
    // Process chart data
    print_r($result['DATA']);
} else {
    // Handle error
    echo "Error: " . $result['MSG'];
}

โš ๏ธ Important Notes

  • The date functionality is not currently supported by the API.
  • Ensure the platform name is correctly specified in the constructor.
  • SSL verification is turned off by default. For production environments, it's recommended to handle SSL verification properly.

๐Ÿ“ƒ License

This project is open-sourced software licensed under the MIT license.


Embrace the power of music charts in your PHP applications with ease! ๐ŸŽ‰๐ŸŽผ

Contributors

Renyu106

Issues