forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://you-tube.eu/feed/ a simple RSS feed
- Loading branch information
1 parent
29e0310
commit 961089e
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
header("Content-Type: application/rss+xml; charset=UTF8"); | ||
|
||
|
||
require_once '../videos/configuration.php'; | ||
|
||
$db = mysqli_connect($mysqlHost,$mysqlUser,$mysqlPass,$mysqlDatabase); | ||
|
||
|
||
|
||
$query = $db->query("SELECT * FROM `videos` WHERE 1 ORDER BY `videos`.`created` DESC LIMIT 10"); | ||
|
||
if ($db->affected_rows >= 1) { | ||
echo'<?xml version="1.0" encoding="UTF-8"?>'?> | ||
|
||
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" | ||
xmlns:wfw="http://wellformedweb.org/CommentAPI/" | ||
xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
xmlns:atom="http://www.w3.org/2005/Atom" | ||
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" | ||
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"> | ||
|
||
<channel> | ||
<title>RSS YOUPHPTube</title> | ||
<description>Rss Feed</description> | ||
<link><?php echo $global['webSiteRootURL'] ;?></link> | ||
<sy:updatePeriod>hourly</sy:updatePeriod> | ||
<sy:updateFrequency>1</sy:updateFrequency> | ||
|
||
<image> | ||
<title>RSS Feed</title> | ||
<url><?php echo $global['webSiteRootURL'] ;?>/videos/userPhoto/logo.png</url> | ||
<link><?php echo $global['webSiteRootURL'] ;?></link> | ||
<width>144</width> | ||
<height>40</height> | ||
<description>YouPHPTube versione rss</description> | ||
</image> | ||
|
||
<?php | ||
while ($row = $query->fetch_assoc()) { | ||
?> | ||
|
||
|
||
<item> | ||
<title><?php echo $row['title']; ?></title> | ||
<description><?php echo $row['description']; ?></description> | ||
<link> <?php | ||
echo $global['webSiteRootURL'] ;?>/video/<?php echo $row['clean_title']; ?></link> | ||
<pubDate><?php echo date('r', strtotime($row['created'])); ?></pubDate> | ||
</item> | ||
|
||
<?php | ||
} | ||
?> | ||
</channel> | ||
</rss> |