-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcategories.php
59 lines (46 loc) · 2.04 KB
/
categories.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
require_once('./etc/config.php');
require_once('./lib/library.php');
if($realtime) {
exec("./bin/update-hq-videos.sh", $buf, $ret);
} else {
$ret = 0;
}
header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n";
$videos = file_get_lines('./data/videos.txt');
$videoSz = sizeof($videos);
?>
<categories>
<?php if($ret): ?>
<category title="Error" description="Error genering video list in bin/update-hq-videos.sh : <?= join($buf) ?>" sd_img="" hd_img=""> </category>
<?php else: ?>
<category title="Videos by Download Date" description="<?= $videoSz ?> videos found" sd_img="<?= imageurl('by-download-date') ?>" hd_img="<?= imageurl('by-download-date') ?>">
<?php
$dates = file_get_lines('./data/dates.txt');
rsort($dates);
foreach($dates as $date) {
echo "<categoryLeaf title='$date' description='Videos from $date' feed='$serverUrl/videos.php?date=$date' />\n";
}
?>
</category>
<category title="Videos by First Character" description="<?= $videoSz ?> videos found" sd_img="<?= imageurl('by-1st-char') ?>" hd_img="<?= imageurl('by-1st-char') ?>">
<?php
$chars = file_get_lines('./data/chars.txt');
foreach($chars as $char) {
$htmlchar = htmlspecialchars($char);
$urlchar = htmlspecialchars($char);
echo "<categoryLeaf title='$htmlchar' description='Videos beginning with $htmlchar' feed='$serverUrl/videos.php?char=$urlchar' />\n";
}
?>
</category>
<category title="All Videos" description="<?= $videoSz ?> videos found" sd_img="<?= imageurl('all-videos') ?>" hd_img="<?= imageurl('all-videos') ?>">
<categoryLeaf title='All' description='All Videos' feed='<?= $serverUrl ?>/videos.php' />
</category>
<?php if($spotify): ?>
<category title="Spotify" description="stream your spotify playlists" sd_img="<?= imageurl('spotify') ?>" hd_img="<?= imageurl('spotify') ?>">
<categoryLeaf title='Spotify' description='Spotify Playlists' feed='<?= $serverUrl ?>/spotify.php' />
</category>
<?php endif ?>
<?php endif ?>
</categories>