45 lines
898 B
PHP
45 lines
898 B
PHP
<?php
|
|
$url = 'https://data.bellz.org/l/i/gidderoni/';
|
|
?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<rss version="2.0">
|
|
|
|
<channel>
|
|
<title>p-view/title>
|
|
<link><?php echo $url; ?></link>
|
|
<description>a tiny php script to automagically display photos</description>
|
|
|
|
|
|
<?php
|
|
|
|
$images = glob("src/*.{png,jpg,JPG}", GLOB_BRACE);
|
|
usort( $images, function( $b, $a ) { return filemtime($a) - filemtime($b); } );
|
|
|
|
|
|
foreach($images as $image) {
|
|
$title = str_replace("_", " ", $image);
|
|
$title = str_replace("src/", "", $title);
|
|
$title = str_replace(".png", "", $title);
|
|
$title = str_replace(".jpg", "", $title);
|
|
$title = str_replace(".JPG", "", $title);
|
|
$anchor = str_replace(" ", "", $title);
|
|
?>
|
|
|
|
<item>
|
|
<title><?php echo $title; ?></title>
|
|
<link><?php echo $url . '#' . $anchor;?></link>
|
|
|
|
<description><![CDATA[
|
|
<img src="<?php echo $url . $image; ?>">
|
|
]]></description>
|
|
</item>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
|
|
</channel>
|
|
</rss>
|
|
|