Created
December 24, 2014 08:27
-
-
Save samcarton/54663eee9c25f8f995f4 to your computer and use it in GitHub Desktop.
Python Script to scrape all songs from Triple J Hottest 100 Shortlist 2014
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 requests | |
url = "https://s3.amazonaws.com/files.madeinkatana.com/jjj/tracks.json" | |
data = requests.get(url).json() | |
fo = open("songs.txt", "wb") | |
for d in data: | |
fo.write(bytes(d["artist"] + " - " + d["name"] + "\r\n", 'UTF-8')) | |
print(d["artist"] + " - " + d["name"]) | |
fo.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script output