1

Update index.php

This commit is contained in:
Evan Pratten 2017-09-13 20:21:08 -04:00 committed by GitHub
parent 439d08859c
commit ca5f27f759

View File

@ -96,9 +96,9 @@
<div class="rantlist-bg"> <div class="rantlist-bg">
<ul class="rantlist">
<!--
<?php
function getContent() { function getContent() {
//Thanks to https://davidwalsh.name/php-cache-function for cache idea //Thanks to https://davidwalsh.name/php-cache-function for cache idea
$file = "./feed-cache.txt"; $file = "./feed-cache.txt";
@ -118,41 +118,30 @@
$html = ""; $html = "";
$newsSource = array( $newsSource = array(
array( array(
"title" => "RetryLife", "title" => "RetryLife-all",
"url" => "https://twitrss.me/twitter_user_to_rss/?user=RetryLife_music" "url" => "http://www.rssmix.com/u/8252161/rss.xml"
),
array(
"title" => "ewpratten",
"url" => "https://twitrss.me/twitter_user_to_rss/?user=Ewpratten"
),
array(
"title" => "nsdesjardins",
"url" => "https://twitrss.me/twitter_user_to_rss/?user=Nsdesjardins345"
) )
); );
function getFeed($url){ function getFeed($url){
$rss = simplexml_load_file($url); $rss = simplexml_load_file($url);
$count = 0; $count = 0;
$html .= '<ul>'; $html .= '<ul class="rantlist">';
foreach($rss->channel->item as$item) { foreach($rss->channel->item as$item) {
$count++; $count++;
if($count > 7){ if($count > 7){
break; break;
} }
$html .= '<li><a href="'.htmlspecialchars($item->link).'">'.htmlspecialchars($item->title).'</a></li>'; $html .= '><a href="'.htmlspecialchars($item->link).'"><li class="rant-comment-row-widget" data-id="829770" data-type="rant" style="background-color:#243447;color:white;"><div class="rantlist-title-text" >'.htmlspecialchars($item->title).'</div> <';
} }
$html .= '</ul>'; $html .= '</ul>';
return $html; return $html;
} }
foreach($newsSource as $source) {
$html .= '<h2>'.$source["title"].'</h2>';
$html .= getFeed($source["url"]);
}
return $html; return $html;
} }
print getContent(); print getContent();
--> ?>
<?php <?php