initial commit

master
Daniel Martinez 2018-07-24 00:58:46 -04:00
commit 988932c040
3 changed files with 27 additions and 0 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
From Aug 2015 ~ April 2017 Last.fm was redoing their front-end and removed the ability to view your personal tags. This resulted in people who were tracking artists with a "seen live" to make their list inaccessible.
This was whipped up by me to create an ugly but functional page with all artists tagged with this specific tag. It could have been generisized to lookup any tag, or made to look pretty with some CSS, but ehhhh. Therein is just the PHP script which an HTML input POSTs to.
My API key has been removed bc duh. Still functional at https://loudly.keybored.me.
Also included an nginx snippet to pass the URI as a username, thus a quick and easy bookmark.

6
nginx.conf Normal file
View File

@ -0,0 +1,6 @@
server {
listen 443 ssl;
location / {
try_files $uri $uri/ /seenlive.php?username=$request_key;
}
}

17
seenlive.php Normal file
View File

@ -0,0 +1,17 @@
<?php
ini_set('allow_url_fopen ','ON');
$url = "http://ws.audioscrobbler.com/2.0/?method=user.getpersonaltags&user={$_POST["username"]}&tag=seen+live&taggingtype=artist&limit=400&api_key=&limit=1500" ;
$xml=simplexml_load_string( file_get_contents($url)) or die("Error: Cannot create object. Check username for spaces.");
$url2 = "http://ws.audioscrobbler.com/2.0/?method=user.gettopartists&user={$_POST["username"]}&limit=400&api_key=";
$xml2=simplexml_load_string( file_get_contents($url2)) or die("Error: Cannot create Object. Check username for spaces.");
echo "<!DOCTYPE html><html><head><title>Wheee, Live Music!</title></head><body>";
echo "Total Seen Live: " ;
echo $xml->taggings[0]['total'] . "<br>" . "<br>";
foreach($xml->taggings->artists->children() as $artist) {
echo '<a href="' . $artist->url . '">' . '<img src="' . $artist->image . '"></a> ' . $artist->name . "<br>";
}
echo "</body></html>";
?>