Skip to content

Instantly share code, notes, and snippets.

@rmdes
Created February 20, 2023 19:21
Show Gist options
  • Save rmdes/6a656e0baf7b5c98a5e05787c4d5f536 to your computer and use it in GitHub Desktop.
Save rmdes/6a656e0baf7b5c98a5e05787c4d5f536 to your computer and use it in GitHub Desktop.
is it new function block with the old Function node N8N
const staticData = getWorkflowStaticData('global');
const newRSSIds = items.map(item => item.json["Date"]);
const oldRSSIds = staticData.oldRSSIds;
if (!oldRSSIds) {
staticData.oldRSSIds = newRSSIds;
return items;
}
const actualNewRSSIds = newRSSIds.filter((id) => !oldRSSIds.includes(id));
const actualNewRSS = items.filter((data) => actualNewRSSIds.includes(data.json['Date']));
staticData.oldRSSIds = [...actualNewRSSIds, ...oldRSSIds];
return actualNewRSS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment