-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcharts.go
32 lines (25 loc) · 900 Bytes
/
charts.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package kkbox
import (
"fmt"
)
// FetchCharts List of song rankings.
func (b *Box) FetchCharts(params ...Param) (*GroupListData, error) {
resp := new(GroupListData)
url := ChartURL
err := b.fetchData(url, resp, params...)
return resp, err
}
// FetchChartPlayList to retrieve information of the song ranking with {playlist_id}.
func (b *Box) FetchChartPlayList(platListID string, params ...Param) (*PlayListData, error) {
resp := new(PlayListData)
url := fmt.Sprintf(ChartPlayListURL, platListID)
err := b.fetchData(url, resp, params...)
return resp, err
}
// FetchChartPlayListTrack to retrieve information of the song ranking with {playlist_id}.
func (b *Box) FetchChartPlayListTrack(platListID string, params ...Param) (*TrackData, error) {
resp := new(TrackData)
url := fmt.Sprintf(ChartPlayListTrackURL, platListID)
err := b.fetchData(url, resp, params...)
return resp, err
}