21 lines
506 B
Text
21 lines
506 B
Text
|
|
#!/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";
|