rssmonster/rssmonster.php

23 lines
665 B
PHP
Raw Normal View History

2022-03-04 03:45:18 +00:00
<?php
declare(strict_types = 1);
2022-03-04 04:14:45 +00:00
// Some dependencies haven't been updated for PHP 8
// This can probably be removed for PHP 7.3
error_reporting(E_ALL & ~E_DEPRECATED);
2022-03-04 21:16:37 +00:00
require_once('vendor/autoload.php');
2022-03-04 03:45:18 +00:00
2022-03-04 21:16:37 +00:00
include_once('config/default.php');
include_once('lib/log.php');
2022-04-08 03:24:22 +00:00
include_once('lib/read-feed.php');
include_once('lib/fetch-site-content.php');
2022-03-14 05:57:45 +00:00
include_once('lib/generate-feed.php');
2022-03-04 03:45:18 +00:00
2022-04-08 03:24:22 +00:00
$existingFeed = readFeed(Config::feedPath);
$content = fetchSiteContent($existingFeed);
$feedXml = generateFeed(array_reverse($content));
2022-03-04 21:05:14 +00:00
Log::info("writing " . strlen($feedXml) . " bytes to " . Config::feedPath);
file_put_contents(Config::feedPath, $feedXml, LOCK_EX);