-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemp.php
37 lines (30 loc) · 937 Bytes
/
temp.php
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
curl_setopt($ch, CURLOPT_URL, "index.php");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "index.php");
$data = curl_exec($ch);
curl_close($ch)
echo $data;
?>
$xml = simplexml_load_file($url);
$tracks = $xml->recenttracks->track;
for ($i = 0; $i < 3; $i++) {
$nowplaying = $tracks[$i]->attributes()->nowplaying;
$trackname = $tracks[$i]->name;
$artist = $tracks[$i]->artist;
$url = $tracks[$i]->url;
$date = $tracks[$i]->date;
$img = $tracks[$i]->children();
$img = $img->image[0];
echo "<a href='" . $url . "' target='TOP'>";
if ($nowplaying == "true") {
echo "Now playing: ";
}
echo "<img src='" . $img . "' alt='album' />
$artist . " - " . $trackname . " @ " . $date . "
</a>
";
}