Skip to content

Instantly share code, notes, and snippets.

@rmdes
Created February 20, 2023 12:31
Show Gist options
  • Save rmdes/3d66715629caa07874fce3666d40b378 to your computer and use it in GitHub Desktop.
Save rmdes/3d66715629caa07874fce3666d40b378 to your computer and use it in GitHub Desktop.
Naej Doree RSS feed function node
const staticData = $getWorkflowStaticData('node');
latestRead = staticData.latestRead || new Date('2023-02-19');
nextLatest = latestRead;
var recentItems = []
for (let item of items) {
var currentDate = new Date(item.pubDate);
if(currentDate > latestRead) {
recentItems.push(item);
if(nextLatest < currentDate) {
nextLatest = currentDate;
}
}
}
staticData.latestRead = nextLatest;
return recentItems;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment