I have developed a script that can do this! It's configured to my needs, but it's pretty straight forward. Hopefully you can find it useful!
Note: spiefeed is required for this. If you don't want to install the spiefeed package, just get simplepie and update line 5 to point to the class file.
<?php
ini_set('display_errors', 1);
require_once(MODX_CORE_PATH . 'components/spiefeed/includes/simplepie/simplepie_1.3.mini.php');
$feeds = $modx->getCollection('modWebLink', [
'parent' => 127
]);
$added = 0;
foreach($feeds as $feed) {
$rss = new SimplePie();
$rss->set_cache_location(MODX_CORE_PATH . 'components/spiefeed/cache');
$rss->set_feed_url($feed->content);
$rss->init();
foreach($rss->get_items() as $item) {
$query = $modx->newQuery('modResource');
$query->where([
'parent' => $feed->id,
'longtitle' => $item->get_id(true)
]);
$exists = $modx->getCount('modResource', $query);
if(!$exists) {
$page = $modx->newObject('modResource');
$page->set('pagetitle', $item->get_title());
$page->set('longtitle', $item->get_id(true));
$page->set('description', $item->get_description(true));
$page->set('alias', $page->cleanAlias($item->get_title()));
$page->set('published', 1);
$page->set('parent', $feed->id);
$page->set('content', $item->get_content(true));
$page->set('template', 10); // RSS Item
$page->set('createdby', 1);
$page->set('createdon', time());
$page->set('publishedby', 1);
$page->set('publishedon', strtotime($item->get_date()));
$page->set('hidemenu', 1);
echo $page->save() ? "Saved {$item->get_id(true)} to {$feed->id}.<br />" : "Error";
// rssUid 15
$page->setTVValue(15, $item->get_id());
libxml_use_internal_errors(true); // Yeah if you are so worried about using @ with warnings
$doc = new DomDocument();
$doc->loadHTML(file_get_contents(html_entity_decode($item->get_id())));
$xpath = new DOMXPath($doc);
$query = '//*/meta[starts-with(@property, \'og:\')]';
$metas = $xpath->query($query);
foreach ($metas as $meta) {
$property = $meta->getAttribute('property');
$content = $meta->getAttribute('content');
$rmetas[$property] = $content;
}
// rssImgUrl 16
$page->setTVValue(16, $rmetas['og:image']);
foreach($item->get_categories() as $category)
$tagString = $category->get_label().", ";
$tagString = substr($tagString, 0, -2);
// rssTags 17
$page->setTVValue(17, $tagString);
$added++;
if($added == 5)
die();
}
}
}
This is a snippet, and I execute it using cron manager.