lastfm_seenlive/seenlive.php

18 lines
918 B
PHP

<?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>";
?>