Skip to content

Instantly share code, notes, and snippets.

View treyholt's full-sized avatar

Trey Holterman treyholt

  • San Francisco, CA
View GitHub Profile
@treyholt
treyholt / script.py
Last active August 26, 2019 20:16 — forked from healthiq-treyHolterman/script.py
Full boar with prompting and searching
import sys
import spotipy
import spotipy.util as util
def findTopSong(sp, artist, allTargetSongs):
allTopTracks = sp.artist_top_tracks(artist['id'] , country='US')['tracks']
if len(allTopTracks) <= 3: return
singleTopTrack = allTopTracks[0] # Grabs top Track
allTargetSongs.append(singleTopTrack)
@treyholt
treyholt / script.py
Last active August 26, 2019 20:15 — forked from healthiq-treyHolterman/script.py
Spotipy Main Setup
import sys
import spotipy
import spotipy.util as util
if __name__ == '__main__':
username = "<Your Username (or user number) here>"
token = util.prompt_for_user_token(username,scope = 'user-top-read',client_id='<Your client ID>',client_secret='<Your client Secret>',redirect_uri='http://localhost/')
if token:
print("Cool we authenticated")
@treyholt
treyholt / script.py
Last active August 26, 2019 20:15 — forked from healthiq-treyHolterman/script.py
Starting to use sp client
import sys
import spotipy
import spotipy.util as util
if __name__ == '__main__':
username = "<Your Username (or user number) here>"
token = util.prompt_for_user_token(username,scope = 'user-top-read',client_id='<Your client ID>',client_secret='<Your client Secret>',redirect_uri='http://localhost/')
if token:
sp = spotipy.Spotify(auth=token)

Keybase proof

I hereby claim:

  • I am treyholt on github.
  • I am treyholterman (https://keybase.io/treyholterman) on keybase.
  • I have a public key ASBsjS2kMH0lMuK8m0ZZ_goGpig0Q-2SkjJm3HbdS-WolAo

To claim this, I am signing this object: