-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstream.php
More file actions
104 lines (80 loc) · 2.71 KB
/
stream.php
File metadata and controls
104 lines (80 loc) · 2.71 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php echo "<?xml version='1.0' ?>"; ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<?php
if($query) {
$queryArr = explode(',', $query);
$page = $queryArr[0];
$nazev = $queryArr[1];
$URL = ('http://www.stream.cz/tema/'.$nazev.'/'.$page);
}
?>
<submenu>
<?php
$sThisFile = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$url = $sThisFile."?query=".($page+10).",".$nazev;
?>
<title>Další strana</title>
<link><?php echo $url;?></link>
</submenu>
<?php
if($page > 1) { ?>
<submenu>
<?php
$sThisFile = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$url = $sThisFile."?query=".($page-10).",".$nazev;
?>
<title>Předchozí strana</title>
<link><?php echo $url;?></link>
</submenu>
<?php }; ?>
<mediaDisplay>
<text offsetXPC=20 offsetYPC=6 widthPC=50 heightPC=6 fontSize=20 backgroundColor=-1:-1:-1 foregroundColor=250:250:250> - Kategorie: <?php echo $nazev;?></text>
</mediaDisplay>
<channel>
<title>Stream.cz</title>
<?php
$html = file_get_contents( $URL );
$videos = explode('page', $html);
foreach($videos as $video) {
$t1 = explode('=', $video);
$t2 = explode('"', $t1[1]);
$d++;
IF (is_numeric($t2[0])) $Max[$d] = $t2[0];
}
IF ($Max!="") $MaxNumPage = max($Max);
if($MaxNumPage >= 10) {
echo "<item>";echo "\n";
echo "<title>Zadej číslo strany (Maximum je $MaxNumPage)</title>";echo "\n";
echo "<link>rss_command://search</link>";echo "\n";
echo "<search url=\"http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']."?query=%s,".$nazev."\" />";echo "\n";
echo "<media:thumbnail url=\"http://zam.opf.slu.cz/baco/image/otaznik.jpg\" />";echo "\n";
echo "</item>"; echo "\n";
}
$videos = explode('<div class="videoListObal">', $html);
unset($videos[0]);
$videos = array_values($videos);
foreach($videos as $video) {
$t1 = explode("background: #000 url('", $video);
$t2 = explode("'", $t1[1]);
$nahled = $t2[0];
$t1 = explode('title="', $video);
$t2 = explode('"', $t1[1]);
$titulek = $t2[0];
$t1 = explode('<a href="', $video);
$t2 = explode('"', $t1[1]);
$link = $t2[0];
$t1 = explode('class="videoListTime">', $video);
$t2 = explode('&', $t1[1]);
$time = $t2[0];
$odkaz = 'http://www.stream.cz'.$link.'';
echo '<item>';echo "\n";
echo '<title>'.$titulek.'</title>';echo "\n";
echo '<link>http://zam.opf.slu.cz/baco/streamsp_link.php?link='.$odkaz.'</link>';echo "\n";
echo '<pubDate>Délka videa: '.$time.'</pubDate>';echo "\n";
echo '<media:thumbnail url="'.$nahled.'" />';echo "\n";
echo '</item>';echo "\n";
echo "\n";
}
?>
</channel>
</rss>