diff --git a/album_art.gif b/album_art.gif index 0b8def4..1589ae9 100644 Binary files a/album_art.gif and b/album_art.gif differ diff --git a/album_art.jpg b/album_art.jpg index f1bd494..ec040ed 100644 Binary files a/album_art.jpg and b/album_art.jpg differ diff --git a/get_oorp.py b/get_oorp.py index 857dd9d..0ff5c95 100755 --- a/get_oorp.py +++ b/get_oorp.py @@ -9,21 +9,19 @@ import urllib class RadioParadise(object): def __init__(self): - rp_dict=self.load_api() + self.load_api() + + def load_api(self): + respons=requests.get("https://api.radioparadise.com/api/now_playing") + rp_dict=respons.json() self.title=rp_dict["title"] self.artist=rp_dict["artist"] self.album=rp_dict["album"] self.year=rp_dict["year"] self.time=rp_dict["time"] self.jpg_path=rp_dict["cover"] - print(self.album) - - def load_api(self): - respons=requests.get("https://api.radioparadise.com/api/now_playing") - rp_dict=respons.json() return rp_dict - def get_list(self): result=(self.title, self.artist, self.album, self.year, self.time) return result @@ -58,21 +56,21 @@ class RPViewer(Tk): self.font=Font(family="Arial", size=14) self.textbox=Text(self, height=6, width=50, font=self.font) self.textbox.insert("1.0", self.rp.get_list()) + self.textbox.config(state=DISABLED) self.textbox.pack() def quit(self): exit() def refresh_textbox(self): + self.textbox.config(state=NORMAL) self.textbox.delete("1.0", "end") self.textbox.insert("1.0", self.rp.get_list()) + self.textbox.config(state=DISABLED) def main(): rp_play=RadioParadise() - print (rp_play.title) - print(rp_play.artist) - print (rp_play.time) app=RPViewer(rp_play) app.mainloop()