generate

package module
v0.0.0-...-fd424da Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 7 Imported by: 0

README

sample-playlist-generator

This is a project to generate a Spotify playlist with a few sample songs of a given artist.

Have you ever seen a supporting band for a concert you're going to, and wondered what they sounded like? Has anybody ever given you a list of bands you should listen to? It's easy enough to go to a band's Spotify page and check out their most popular songs, but that can be time-consuming and labor-intensive, because you have to search for each artist individually. With this app, you can enter a comma-separated list of artists, and the system will generate a playlist with 2-3 of each artist's most popular songs.

Happy listening!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTracksToSpotifyPlaylist

func AddTracksToSpotifyPlaylist(trackIds []string, playlistId string, accessToken string) string

func CreateEmptySpotifyPlaylist

func CreateEmptySpotifyPlaylist(playlistName string, accessToken string) string

func GeneratePlaylist

func GeneratePlaylist(artistNames []string, playlistName string)

func GetTopTrackIds

func GetTopTrackIds(artistId string, accessToken string) []string

func RefreshSpotifyAuth

func RefreshSpotifyAuth() (string, error)

Types

type SpotifyAddTrackToPlaylistResponse

type SpotifyAddTrackToPlaylistResponse struct {
	SnapshotId string `json:"snapshot_id"`
}

type SpotifyAlbum

type SpotifyAlbum struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	ReleaseDate string `json:"release_date"`
}

type SpotifyArtist

type SpotifyArtist struct {
	Items []SpotifyArtistItem `json:"items"`
}

type SpotifyArtistItem

type SpotifyArtistItem struct {
	Genres     []string `json:"genres"`
	Id         string   `json:"id"`
	Name       string   `json:"name"`
	Popularity int      `json:"popularity"`
	Type       string   `json:"type"`
}

func SearchForArtist

func SearchForArtist(artistName string, accessToken string) SpotifyArtistItem

type SpotifyCreatePlaylistRequest

type SpotifyCreatePlaylistRequest struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Public      bool   `json:"public"`
}

type SpotifyCreatePlaylistResponse

type SpotifyCreatePlaylistResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type SpotifyRefreshTokenResponse

type SpotifyRefreshTokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
	Scope       string `json:"scope"`
}

type SpotifySearchResponse

type SpotifySearchResponse struct {
	Artists SpotifyArtist `json:"artists"`
}

type SpotifyTopTracksResponse

type SpotifyTopTracksResponse struct {
	Tracks []SpotifyTrack `json:"tracks"`
}

type SpotifyTrack

type SpotifyTrack struct {
	Album       SpotifyAlbum        `json:"album"`
	Artists     []SpotifyArtistItem `json:"artists"`
	Id          string              `json:"id"`
	Name        string              `json:"name"`
	Popularity  int                 `json:"popularity"`
	TrackNumber int                 `json:"track_number"`
}

Directories

Path Synopsis
cmd
api
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL