Home Reference Source
public class | source

ChartFetcher

Extends:

Fetcher → ChartFetcher

The fetcher that can fetch chart playlists.

See:

Method Summary

Public Methods
public

Fetch chart playlists.

public

Fetch playlist of the chart you set.

public

fetchTracks(limit: number, offset: number): Promise

Fetch tracks of the playlist with the chart fetcher you init.

public

Init the chart fetcher.

Inherited Summary

From class Fetcher
public

fetchNextPage(fulfillment: fulfillment, nextUriPath: String): Promise

Fetches next page of various paged APIs.

public

hasNextPage(fulfillment: fulfillment, nextUriPath: String): Boolean

Is next page available for various paged APIs.

public

setTerritory(territory: string): Fetcher

Set the fetcher's territory.

Public Methods

public fetchCharts(): Promise source

Fetch chart playlists.

Return:

Promise

Example:

api.chartFetcher.fetchCharts();

See:

public fetchMetadata(): Promise source

Fetch playlist of the chart you set.

Return:

Promise

Example:

api.chartFetcher.setPlaylistID('4mJSYXvueA8t0odsny').fetchMetadata();

See:

public fetchTracks(limit: number, offset: number): Promise source

Fetch tracks of the playlist with the chart fetcher you init. Result will be paged.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size of one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.chartFetcher.setPlaylistID('4mJSYXvueA8t0odsny').fetchTracks();

See:

public setPlaylistID(playlistID: string): ChartFetcher source

Init the chart fetcher.

Params:

NameTypeAttributeDescription
playlistID string

The playlist ID.

Return:

ChartFetcher

See: