Page MenuHomePhorge

spotify_playlist_popularity.php
No OneTemporary

spotify_playlist_popularity.php

<html>
<head>
<title>Spotify playlist track popularity rank</title>
<meta name="description" content="Simple form for entering a Spotify playlist and returning a list ranked by popularity score">
</head>
<body>
<form action="" method="GET">
<p><strong>Enter a Spotify playlist URL:</strong> <input name="URL" id="URL"></p>
<p><button>Submit</button></p>
</form>
<p>Pro-tip: this is secretly a TSV spreadsheet for you nerrrrds</p>
<br/>
<?php
if($_GET['URL']) {
$url = $_GET['URL'];
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
die("Sorry, only valid URLs are currently supported. Take it up with Keith! He probably just forgot to make URIs work too. Or maybe what you pasted in isn't valid as either...");
}
# Run Python script (should rewrite in PHP sometime...)
$out = shell_exec("python3 generate_hot100.py $url");
if (strpos($out, "[]") === FALSE) {
print("</pre>".$out."</pre>");
} else {
print("Didn't seem to get a valid response from Spotify's API, pester Keith to figure out why");
}
#error_log("Okay, done");
} else {
#error_log("No URL?");
}
?>
</body>
</html>

File Metadata

Mime Type
text/html
Expires
Thu, Jan 23, 3:53 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
131313
Default Alt Text
spotify_playlist_popularity.php (1 KB)

Event Timeline