1.2.2 โ€ข Published 5 months ago

melona v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Melona๐Ÿˆ - ๋ฉœ๋ก  API ๋น„๊ณต์‹ ๊ตฌํ˜„

License stars - melonchart forks - melonchart npm version Build Test

https://nodei.co/npm/melona.png?downloads=true&downloadRank=true&stars=true

og_image

๋ฉœ๋ก  ์Œ์› ์„œ๋น„์Šค์˜ ์—ฌ๋Ÿฌ ๋ฐ์ดํ„ฐ๋ฅผ ์‰ฝ๊ฒŒ ์Šคํฌ๋ž˜ํ•‘ ํ•  ์ˆ˜ ์žˆ๋Š” API ์ž…๋‹ˆ๋‹ค.

Features

  • ๋ฉœ๋ก  ์›น ์‚ฌ์ดํŠธ์˜ ๋‹ค์–‘ํ•œ ์ข…๋ฅ˜์˜ ๋ฐ์ดํ„ฐ๋ฅผ JSON์œผ๋กœ ๋ณ€ํ™˜

    • ๋ฉœ๋ก ์ฐจํŠธ TOP100
    • ๋ฉœ๋ก  ์ตœ์‹  ์Œ์•…
    • ๋ฉœ๋ก  ์Œ์•… ๊ฒ€์ƒ‰
    • ๋ฉœ๋ก  ์ธ๊ธฐ ํ‚ค์›Œ๋“œ
  • ๋น„๋™๊ธฐ(async/await) ์ง€์›

  • ๋‚ด์žฅ ํƒ€์ž… ์„ ์–ธ(d.ts) ์ œ๊ณต

Install

npm install melona

Base Types

interface ISongData {
  songNo: number;
  title: string;
  artist: string;
  album: string;
  likeCnt: number;
}

searchSong(params: ISearchParams) => Promise<ISearchSong[]>

import { MelonSearch } from 'melona';

const melonSearch = new MelonSearch();
const data = await melonSearch.searchSong({
  query: '์œคํ•˜', // ์‹ค์ œ ๊ฒ€์ƒ‰์–ด๋กœ ์น˜ํ™˜ํ•˜์„ธ์š”.
  section: 'artist', // ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์˜ต์…˜: all, artist, song, album
});

console.log(data);
type SearchSection = 'all' | 'artist' | 'song' | 'album';
interface ISearchParams {
  query: string;
  section?: SearchSection;
}
interface ISearchSong extends ISongData {
  num: number;
}

getChart() => Promise<IChartData[]>

import { MelonChart } from 'melona';

const melonChart = new MelonChart();
const chart = await melonChart.getChart();

console.log(chart);
interface IChartData extends ISongData {
  rank: number;
  albumImg: string;
}

getTable() => Promise<INewMusicData[]>

import { MelonNewMusic } from 'melona';

const melonNewMusic = new MelonNewMusic();
const table = await melonNewMusic.getTable();

console.log(table);
interface INewMusicData extends ISongData {
  num: number;
  songNo: number;
  albumImg: string;
}

getKeywords() => Promise\

import { MelonKeywords } from 'melona';

const melonKeywords = new MelonKeywords();
const keywords = await melonKeywords.getKeywords();

console.log(keywords.trending); // ์‹ค์‹œ๊ฐ„ ๊ธ‰์ƒ์Šน ํ‚ค์›Œ๋“œ
console.log(keywords.popular); // ์ธ๊ธฐ ํ‚ค์›Œ๋“œ
interface IKeyword {
  rank: number;
  keyword: string;
  rankChanges: string;
}
interface IKeywordChart {
  trending: IKeyword[];
  popular: IKeyword[];
}

License

MIT

1.2.2

5 months ago

1.2.1

5 months ago

1.2.0

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago