Check external RSS feed on pre-set day in the week and time of the day and sync frequency.
I am a podcast host and producer and for many years I was using MODX for my website. But after an podcast episode, I had to copy the content from the podcast platform and add it to MODX.
In 2023 I switched to the other CMS I will not mention the name (WP because there is this great plugin to import a podcast episode to a WP post, WP Podcast Importer.
I would really really love to have this feature in MODX. Iâve looked for an solution but can seem to find it. What I found on the form is to look at GetFeed, Spiefeed.
It seem it would need two parts:
1 xml parser to check the RSS url.
2 Have an event / cron job checking for an update in the RSS.
So what this plugin does is check for new content in the RSS item. You can set it to check it per day, per week, per month. So you can set the import interval. Import the podcast episode image.
And of course settings to determine how to post the content to a post.
Is there anyone who would like to help me create this in MODX?
For cron you could use the extra CronManager. This extra allows you to run a MODX snippet periodically with cron.
Do you use MODX 2.x or MODX 3?
With MODX 2.x, you could use the class modRSSParser (that is also used in the extra getFeed).
In MODX 3, modRSSParser doesnât seem to exist anymore. You probably have to use SimplePie (that is a dependency of MODX 3) instead.
For this task you have to write a custom snippet.
How good are your programming skills?
Here is some MODX code, that uses SimplePie to download and parse an RSS feed (for the âNews Feedâ widget on the dashboard):
In your snippet, you could do something similar.
(Replace $this->modx with $modx in the snippet code).
To programmatically add a new resource in MODX, you can use code like this
use MODX\Revolution\modResource;
$doc = $modx->newObject(modResource::class); // create a new resource
$doc->set('parent', 1); // set the fields to their values
$doc->set('pagetitle', 'new resource');
$doc->set('template', 1);
$doc->setContent('some content');
...
$doc->save(); // save the resource
or alternatively call the âresource/createâ processor: