mirror of
https://github.com/KevinMidboe/homehub.git
synced 2025-10-29 17:40:26 +00:00
First com, added hmtl folder
This commit is contained in:
21
phpFiles/apRss.php
Normal file
21
phpFiles/apRss.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$rss = new DOMDocument();
|
||||
$rss->load('http://www.aftenposten.no/eksport/rss-1_0/');
|
||||
$feed = array();
|
||||
foreach ($rss->getElementsByTagName('item') as $node) {
|
||||
$item = array (
|
||||
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
|
||||
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
|
||||
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
|
||||
);
|
||||
array_push($feed, $item);
|
||||
}
|
||||
$limit = 4;
|
||||
for($x=0;$x<$limit;$x++) {
|
||||
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
|
||||
$link = $feed[$x]['link'];
|
||||
$description = $feed[$x]['desc'];
|
||||
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
|
||||
echo '<p>'.$description.'</p>';
|
||||
}
|
||||
?>
|
||||
21
phpFiles/dbRss.php
Normal file
21
phpFiles/dbRss.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
$rss = new DOMDocument();
|
||||
$rss->load('http://www.dagbladet.no/rss/nyheter/');
|
||||
$feed = array();
|
||||
foreach ($rss->getElementsByTagName('item') as $node) {
|
||||
$item = array (
|
||||
'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
|
||||
'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
|
||||
'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
|
||||
);
|
||||
array_push($feed, $item);
|
||||
}
|
||||
$limit = 4;
|
||||
for($x=0;$x<$limit;$x++) {
|
||||
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
|
||||
$link = $feed[$x]['link'];
|
||||
$description = $feed[$x]['desc'];
|
||||
echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
|
||||
echo '<p>'.$description.'</p>';
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user