|
|
|
@ -3,6 +3,11 @@ require_once ("vendor/autoload.php");
|
|
|
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
|
|
|
|
|
|
|
$config = Yaml::parse(file_get_contents('config.yml'));
|
|
|
|
|
$lastrun = 0;
|
|
|
|
|
if (file_exists('.lastrun')) {
|
|
|
|
|
$lastrun = file_get_contents('.lastrun');
|
|
|
|
|
}
|
|
|
|
|
echo $lastrun;
|
|
|
|
|
|
|
|
|
|
function get_text($url) {
|
|
|
|
|
$curl = curl_init();
|
|
|
|
@ -29,6 +34,9 @@ $articles = $service->parse($string)[0]['value'];
|
|
|
|
|
unset($string);
|
|
|
|
|
$pandoc = new \Pandoc\Pandoc();
|
|
|
|
|
foreach ($articles as $article) {
|
|
|
|
|
if (strtotime($article['pubDate']) <= $lastrun) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$title = $article['title'];
|
|
|
|
|
$link = $article['link'];
|
|
|
|
|
$description = $article['description'];
|
|
|
|
@ -52,3 +60,4 @@ foreach ($articles as $article) {
|
|
|
|
|
echo $description;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
file_put_contents('.lastrun', time());
|
|
|
|
|