Add files via upload
This commit is contained in:
parent
7807797ef5
commit
4824587b45
39
community/getrss.php
Normal file
39
community/getrss.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
$xml=("http://www.rssmix.com/u/8252161/rss.xml");
|
||||||
|
|
||||||
|
$xmlDoc = new DOMDocument();
|
||||||
|
$xmlDoc->load($xml);
|
||||||
|
|
||||||
|
//get elements from "<channel>"
|
||||||
|
$channel=$xmlDoc->getElementsByTagName('channel')->item(0);
|
||||||
|
$channel_title = $channel->getElementsByTagName('title')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
$channel_link = $channel->getElementsByTagName('link')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
$channel_desc = $channel->getElementsByTagName('description')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
|
||||||
|
//output elements from "<channel>"
|
||||||
|
echo("<p><a href='" . $channel_link
|
||||||
|
. "'>" . $channel_title . "</a>");
|
||||||
|
echo("<br>");
|
||||||
|
echo($channel_desc . "</p>");
|
||||||
|
|
||||||
|
|
||||||
|
//get and output "<item>" elements
|
||||||
|
$x=$xmlDoc->getElementsByTagName('item');
|
||||||
|
for ($i=0; $i<=2; $i++) {
|
||||||
|
$item_title=$x->item($i)->getElementsByTagName('title')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
$item_link=$x->item($i)->getElementsByTagName('link')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
$item_desc=$x->item($i)->getElementsByTagName('description')
|
||||||
|
->item(0)->childNodes->item(0)->nodeValue;
|
||||||
|
echo ("<p><a href='" . $item_link
|
||||||
|
. "'>" . $item_title . "</a>");
|
||||||
|
echo ("<br>");
|
||||||
|
echo ($item_desc . "</p>");
|
||||||
|
}
|
||||||
|
?>
|
@ -79,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div style="padding:6px; background-color:#ff0000; border-radius:8px;">
|
<div style="padding:6px; background-color:#ff0000; border-radius:8px;">
|
||||||
<a href="https://www.youtube.com/channel/UCxzARKt0_U0sLHbF4pDN1Pw?sub_confirmation=1">Subscribe to RetryLife Official</a>
|
<a href="https://www.youtube.com/channel/UCxzARKt0_U0sLHbF4pDN1Pw?sub_confirmation=1">Subscribe to Nathan Desjardins</a>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -97,36 +97,30 @@
|
|||||||
|
|
||||||
<div class="rantlist-bg">
|
<div class="rantlist-bg">
|
||||||
<ul class="rantlist">
|
<ul class="rantlist">
|
||||||
|
<script>
|
||||||
<?php
|
function showRSS(str) {
|
||||||
$files = glob('content/*.{json}', GLOB_BRACE);
|
if (str.length==0) {
|
||||||
foreach($files as $file) {
|
document.getElementById("rssOutput").innerHTML="";
|
||||||
//do your work here
|
return;
|
||||||
|
}
|
||||||
|
if (window.XMLHttpRequest) {
|
||||||
$url = $file;
|
// code for IE7+, Firefox, Chrome, Opera, Safari
|
||||||
$content = file_get_contents($url);
|
xmlhttp=new XMLHttpRequest();
|
||||||
$json = json_decode($content, true);
|
} else { // code for IE6, IE5
|
||||||
echo '<li class="rant-comment-row-widget" data-id="829770" data-type="rant" style="background-color:#243447;color:white;"><div class="rantlist-title-text" >';
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
echo $json{title};
|
}
|
||||||
echo " - ";
|
xmlhttp.onreadystatechange=function() {
|
||||||
echo $json{author};
|
if (this.readyState==4 && this.status==200) {
|
||||||
echo '</div> <';
|
document.getElementById("rssOutput").innerHTML=this.responseText;
|
||||||
echo $json{type};
|
}
|
||||||
echo ' src="';
|
}
|
||||||
echo $json{src}; echo '" href="';
|
xmlhttp.open("GET","getrss.php?q="+str,true);
|
||||||
echo $json{href};
|
xmlhttp.send();
|
||||||
echo '" width=100%>';
|
}
|
||||||
echo $json{body};
|
</script>
|
||||||
echo '</';
|
|
||||||
echo $json{type};
|
<div id="rssOutput">RSS-feed will be listed here...</div>
|
||||||
echo '>';
|
|
||||||
echo '</li>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
27
community/phpjsonloader.php
Normal file
27
community/phpjsonloader.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$files = glob('content/*.{json}', GLOB_BRACE);
|
||||||
|
foreach($files as $file) {
|
||||||
|
//do your work here
|
||||||
|
|
||||||
|
|
||||||
|
$url = $file;
|
||||||
|
$content = file_get_contents($url);
|
||||||
|
$json = json_decode($content, true);
|
||||||
|
echo '<li class="rant-comment-row-widget" data-id="829770" data-type="rant" style="background-color:#243447;color:white;"><div class="rantlist-title-text" >';
|
||||||
|
echo $json{title};
|
||||||
|
echo " - ";
|
||||||
|
echo $json{author};
|
||||||
|
echo '</div> <';
|
||||||
|
echo $json{type};
|
||||||
|
echo ' src="';
|
||||||
|
echo $json{src}; echo '" href="';
|
||||||
|
echo $json{href};
|
||||||
|
echo '" width=100%>';
|
||||||
|
echo $json{body};
|
||||||
|
echo '</';
|
||||||
|
echo $json{type};
|
||||||
|
echo '>';
|
||||||
|
echo '</li>';
|
||||||
|
}
|
||||||
|
?>
|
Loading…
x
Reference in New Issue
Block a user