GithubHelp home page GithubHelp logo

cable8mm / water-melon Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 1.0 137 KB

Water Melon is simple melon.com api sdk for php

Home Page: https://www.palgle.com/water-melon/

License: MIT License

PHP 100.00%
composer kpop melon php crawler laravel package

water-melon's Introduction

code-style run-tests Packagist Version Packagist Downloads Packagist Dependency Version Packagist Stars Packagist License

Water Melon

This library is designed for retrieving information about artists, songs, and albums using their respective IDs from https://www.melon.com.

We have provided the API Documentation on the web. For more information, please visit https://www.palgle.com/water-melon/ ❤️

Features

  • Fetches information about songs, artists, and albums
  • To be able to retrieve information about artists and albums using the Melon song ID
  • Customize the fields according to your needs for easy access

Installation

composer require cable8mm/water-melon

Usage

Get song info:

$waterMelon = WaterMelon::make(35945927);   // Ditto's song id

print $waterMelon->song->id;
//=> 35945927

print $waterMelon->album->id;
//=> 11127145

print $waterMelon->artists[0]->id;
//=> 3114174

and fantastic resource inspired by laravel resource:

$waterMelon = WaterMelon::make(35945927);
// Ditto's Melon song ID

$song = SongResource::make($waterMelon->getSong());

print $song->title;
//=> Ditto
print $song->album_id;
//=> 11127145
print $song->artwork_image_path;
//=> https://cdnimg.melon.co.kr/cm2/album/images/111/27/145/11127145_20231213133532_500.jpg?42f8389c13de0f5f8e4c722bbb0d4bd7/melon/resize/144/optimize/90

$artist = ArtistResource::make($waterMelon->getArtists()[0]);

print $artist->melon_artistid;
//=> 3114174
print $artist->name;
//=> NewJeans
print $artist->featured_image_path;
//=> https://cdnimg.melon.co.kr/cm2/artistcrop/images/031/14/174/3114174_20231219153524_500.jpg?8d4887c3dea0a5262fe256c1aef2a9d2/melon/resize/100/optimize/90

$album = AlbumResource::make($waterMelon->getAlbum());

print $album->melon_albumid;
//=> 11127145
print $album->title;
//=> NewJeans 'OMG'
print $album->album_cover_path;
//=> https://cdnimg.melon.co.kr/cm2/album/images/111/27/145/11127145_20231213133532_500.jpg?42f8389c13de0f5f8e4c722bbb0d4bd7/melon/resize/255/optimize/90
print $album->released_at;
//=> 2023.01.02

Specification

You can refer to the Markdown documents for melon.com JSON specifications:

Lint

composer lint

Test

composer test

License

The Water Melon project is open-sourced software licensed under the MIT license.

water-melon's People

Contributors

cable8mm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kangsan-ks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.