fedi-feed-router/bin/check-and-post

21 lines
506 B
Text
Raw Normal View History

2025-06-28 12:08:34 +02:00
#!/usr/bin/env php
<?php
require __DIR__ . '/../bootstrap/autoload.php';
use Feddev\LemmyArticlePoster\Domain\Articles\ArticleFetcher;
$articles = ArticleFetcher::getNewArticles();
$newArticles = $articles->filter(function($article) {
return $article->wasRecentlyCreated;
});
echo "Found " . $articles->count() . " articles (" . $newArticles->count() . " new)\n";
$newArticles->each(function($article) {
echo "New article: " . $article->url . "\n";
// $article->publish();
});
echo "\n";