-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtunes.html.bak
59 lines (40 loc) · 1.97 KB
/
tunes.html.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Tunes</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="stylesheet.css" type="text/css" rel="stylesheet">
</head>
<body>
<iframe src="tophalf.html" onload="this.insertAdjacentHTML('afterend', (this.contentDocument.body||this.contentDocument).innerHTML);this.remove()"></iframe>
<a href="http://www.last.fm/user/jamoiholland">
<?php
$curl = curl_init('http://ws.audioscrobbler.com/2.0/?method=user.getinfo&user=jamoiholland&api_key=b2e79ec401ff78b71c5f7b119b68dd7d');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
$xml = simplexml_load_string($result);
echo "<img src=\"" . $xml->user->image[1] . "\" border=\"0\">";
?>
jamoiholland</a>
<div class="container"><div class="tune"></div>
<?php
$curl = curl_init('http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=jamoiholland&limit=100&api_key=b2e79ec401ff78b71c5f7b119b68dd7d');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
$xml = simplexml_load_string($result);
// $xml = simplexml_load_file("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=jamoiholland&limit=100&api_key=b2e79ec401ff78b71c5f7b119b68dd7d");
// printf("<pre>%s</pre>\n", print_r($xml->recenttracks, 1));
foreach ($xml->recenttracks->track as $track) {
echo "<div class=\"tune\">";
if($track->attributes() == "true") echo "Now Playing: "; else echo "" . $track->date . "<br>";
echo "" . $track->artist . " - <a href=\"" . $track->url . "\">" . $track->name . "</a>";
//if($track->album != "") echo $track->album . ")\n"; else echo " -\n";
echo "</div>";
}
?>
</div>
<iframe src="bottomhalf.html" onload="this.insertAdjacentHTML('afterend', (this.contentDocument.body||this.contentDocument).innerHTML);this.remove()"></iframe>
</body>
</html>