Skip to content

Instantly share code, notes, and snippets.

@64b2b6d12b
64b2b6d12b / shorten.py
Created March 30, 2018 22:40
Need to function this
#Get initial tracks for playlist and save to JSON file
tracks_file_count = 0
tracks_file_name = f'{str(tracks_file_count)}_tracks.json'
tracks_file = open(tracks_file_name,'w+')
tracks_response = requests.request('GET', f'{config.global_url}/users/{user}/playlists/{playlist_id}/tracks', headers=headers)
tracks_file.write(tracks_response.text)
tracks_file.close()
tracks_file = open(tracks_file_name,'r')
tracks = json.load(tracks_file)
#Save comma seperated track ID's to variable
@64b2b6d12b
64b2b6d12b / spotify_platform_oauth.sh
Created May 29, 2017 00:28 — forked from hughrawlinson/spotify_platform_oauth.sh
Authenticate and get an oauth token for your Spotify app from the command line
#!/bin/bash
# spotify_platform_oauth.sh
#
# A script to quickly and easily generate Spotify oauth tokens given a client
# id, secret, and scope. Will authenticate a user via the browser.
# The app must have "http://localhost:8082/' as a redirect_uri
# spotify_client_creds.json should contain a spotify client id and secret pair