Skip to content

danwa5/flavor-favs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flavor Favs

This is a Go CLI tool that uses a wrapper to make calls to the Spotify Web API to fetch your favorite artists and tracks. Your favorites from 3 time ranges (4 weeks, 6 months, and several years) will be displayed.

Getting Started

To allow Flavor Favs access to your personal Spotify data, you'll need to obtain a client ID and secret key for the application to use.

  1. Log in to Spotify Developer Dashboard
  2. Click on Create an App
  3. Register your app
  • Enter an App Name
  • Enter an App Description
  • Click Create
  1. After redirect, click on your app and take note of your client ID and secret key. DO NOT share these with anyone!
  2. Click on Edit Settings and enter a redirect URI. If you don't have one, just default to http://localhost:8080/callback. This URI enables Spotify to invoke the Flavor Favs application after successful authentication.
  3. Set your environment variables. In your terminal, you can run:
$ export SPOTIFY_CLIENT_ID=<YOUR CLIENT ID>
$ export SPOTIFY_CLIENT_SECRET=<YOUR SECRET KEY>
$ export SPOTIFY_REDIRECT_URI=<YOUR REDIRECT URI>

Testing and Building the Go Binary

Install Golang: https://go.dev/doc/install

Clone the repo

$ git clone <REPO>

Test the application

$ go run main.go

Build the executable binary

$ go build

Usage

Before you can run the executable binary, make sure it has execute privileges

$ chmod 744 flavor-favs

Run the app in the directory of the flavor-favs binary. If you're using a Mac, you may get a "Developer cannot be verified" warning, in which case you'll need to go to your System Preferences to allow permissions for the program to run.

See the available command line options:

$ ./flavor-favs -h
Usage of ./flavor-favs:
  -limit int
        the number of results per data set (default 10)
  -type string
        "artists" or "tracks" (default "artists")

See your favorite artists:

$ ./flavor-favs -type artists

See your favorite tracks:

$ ./flavor-favs -type tracks

Change the number of results in each data set:

$ ./flavor-favs -type artists -limit 20

Helpful Resources

About

A Golang command line tool to fetch your favorite Spotify artists and tracks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages