Created
August 29, 2022 07:29
-
-
Save SKaplanOfficial/321b1fcbab713b4c6dab2dbbb782a86b to your computer and use it in GitHub Desktop.
Play the previews for the top 10 songs on iTunes parsed from Apple's RSS feed using PyXA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyXA | |
reader = PyXA.RSSFeed("http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/limit=10/xml") | |
links = reader.items().links() | |
m4as = filter(lambda x: "m4a" in x.url, links) | |
for index, song in enumerate(m4as): | |
print("Now playing: " + reader.items()[index].title) | |
sound = PyXA.XASound(song) | |
sound.play() | |
sleep(sound.duration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment