|
|
|
|
- Read General Notes
- Read How to install Apache HTTP Server for HTTP (Web) Server service?
- Read How to install PHP for Apache HTTP Server?
e.g. Assumed that RSS is DistroWatch.com - News
wget -c https://frankandjacq.com/ubuntuguide/magpierss-0.71.1.tar.gz
sudo mkdir /var/www/feeds
sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/
sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/
sudo rm -fr /var/www/feeds/magpierss-0.71.1/
sudo chown -R www-data:root /var/www/feeds/
sudo gedit /var/www/feeds/index.php
- Insert the following lines into the new file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>DistroWatch.com - News</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css">
/*<![CDATA[*/
/*
DEFAULT TAG STYLES
*/
body {
background: #ffffff;
margin-left: 20px;
font-family: bitstream vera sans,sans-serif;
font-size: 9pt;
}
h1 {
font-family: luxi sans,sans-serif;
font-size: 15pt;
}
/*]]>*/
</style>
</head>
<body>
<?php
require_once 'rss_fetch.inc';
error_reporting(E_ERROR);
$url = 'https://distrowatch.com/news/dw.xml';
$rss = fetch_rss($url);
if ($rss) {
echo "<h1>";
echo "<a href=$url>", $rss->channel[title], "</a><br/>";
echo "</h1>";
foreach ($rss->items as $item ) {
$url = $item[link];
$title = $item[title];
$description = $item[description];
echo "<li>";
echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
echo "$description<br/><br/>";
echo "</li>";
}
}
else {
echo "<a href=$url>", $url, "</a> - Server Down!<br/>";
}
?>
</body>
</html>
- Save the edited file (sample)
- https://localhost/feeds/index.php
|
|
|