-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhits.go
32 lines (25 loc) · 864 Bytes
/
hits.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"
)
// FetchHits List of new hits playlists.
func (b *Box) FetchHits(params ...Param) (*GroupListData, error) {
resp := new(GroupListData)
url := ChartURL
err := b.fetchData(url, resp, params...)
return resp, err
}
// FetchHitPlayList retrieve information of the new hits playlist with {playlist_id}.
func (b *Box) FetchHitPlayList(playList string, params ...Param) (*PlayListData, error) {
resp := new(PlayListData)
url := fmt.Sprintf(NewHitPlayListURL, playList)
err := b.fetchData(url, resp, params...)
return resp, err
}
// FetchHitPlayListTrack list of tracks of a new hits playlist.
func (b *Box) FetchHitPlayListTrack(playList string, params ...Param) (*TrackData, error) {
resp := new(TrackData)
url := fmt.Sprintf(NewHitPlayListTrackURL, playList)
err := b.fetchData(url, resp, params...)
return resp, err
}