Page MenuHomePhorge

generate_hot100.py
No OneTemporary

generate_hot100.py

#!/usr/bin/env python3
import csv
import json
import sys
import tekore as tk
import pyml_config as config
import libmusicleague as lml
from pprint import pprint
# Set up Spotify connection using client token
conf = (config.client_id, config.client_secret)
token = tk.request_client_token(*conf)
spotify = tk.Spotify(token)
# Get URI or URL from first argument
ur = str(sys.argv[1])
urt = lml.ur_type(ur)
st = lml.spotify_type(ur)
if st == "playlist":
if urt == "url":
uri = tk.from_url(ur)[1]
pl = lml.play_list(uri)
lml.print_hot(pl)
elif urt == "uri":
pl = lml.play_list(urt)
lml.print_hot(pl)

File Metadata

Mime Type
text/x-python
Expires
Thu, Jan 23, 2:31 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131183
Default Alt Text
generate_hot100.py (614 B)

Event Timeline