Skip to content

Add automated RSS feed importer for AI4EOSC news - #7

Merged
alvarolopez merged 4 commits into
mainfrom
copilot/add-rss-feed-story-fetcher
Jun 22, 2026
Merged

alvarolopez merged 4 commits into
mainfrom
copilot/add-rss-feed-story-fetcher

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Implements automated daily ingestion of news from AI4EOSC domains (origin, fluid, arena) into the stories collection.

Implementation

  • scripts/import-rss-feeds.mjs: Fetches RSS feeds, parses XML, and generates story markdown files with proper frontmatter. Deduplicates by comparing externalUrl fields against existing stories.

  • .github/workflows/import-rss-feeds.yml: Runs daily at 6 AM UTC. Commits new stories only when changes detected. Manual trigger available via workflow_dispatch.

Generated Story Format

---
title: "Story Title"
type: News
date: 2026-06-19
excerpt: Extracted from RSS description, truncated to 200 chars...
image: https://domain.ai4eosc.eu/path/to/image.png
externalUrl: https://domain.ai4eosc.eu/original-post/
---

Filenames follow YYYY-MM-DD-slug.md pattern. Images extracted from feed content when available.

@alvarolopez

Copy link
Copy Markdown
Contributor

@copilot this PR creates a new commit, but I would prefer that it opens a pull-request so that we can review it.

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@alvarolopez I've opened a new pull request, #8, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* chore: open PR instead of direct commit in RSS importer workflow

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@alvarolopez
alvarolopez marked this pull request as ready for review June 22, 2026 07:55
Copilot AI review requested due to automatic review settings June 22, 2026 07:55
@alvarolopez
alvarolopez merged commit 1d5e713 into main Jun 22, 2026
@alvarolopez
alvarolopez deleted the copilot/add-rss-feed-story-fetcher branch June 22, 2026 07:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated ingestion of RSS feed items from AI4EOSC subdomains into src/content/stories/ and automates running it daily via GitHub Actions.

Changes:

  • Introduces a Node.js RSS importer script that fetches feeds, parses items, deduplicates by externalUrl, and writes story Markdown files.
  • Adds a scheduled GitHub Actions workflow to run the importer daily and open a PR when new stories are generated.
  • Documents the importer’s behavior and manual usage under scripts/.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/README.md Documents the RSS importer script, feed sources, and manual/automated execution.
scripts/import-rss-feeds.mjs Implements fetching/parsing RSS and generating story Markdown frontmatter files.
.github/workflows/import-rss-feeds.yml Runs the importer on a daily schedule and opens a PR with new story files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +133 to +148
function createStoryContent(item) {
const dateStr = item.pubDate.toISOString().split('T')[0];

// Truncate description to a reasonable length for excerpt
let excerpt = item.description;
if (excerpt.length > 200) {
excerpt = excerpt.substring(0, 197) + '...';
}

const frontmatter = [
'---',
`title: "${item.title.replace(/"/g, '\\"')}"`,
`type: News`,
`date: ${dateStr}`,
`excerpt: ${excerpt.replace(/"/g, '\\"')}`,
];
Comment on lines +74 to +83
if (title && link && pubDate) {
items.push({
title: cleanText(title),
link: link.trim(),
pubDate: new Date(pubDate),
description: cleanText(description),
image: imageUrl,
feedUrl
});
}
Comment on lines +119 to +128
function generateFilename(title, date) {
const dateStr = date.toISOString().split('T')[0]; // YYYY-MM-DD
const slug = title
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
.substring(0, 50);

return `${dateStr}-${slug}.md`;
}
Comment on lines +213 to +225
for (const item of newItems) {
const filename = generateFilename(item.title, item.pubDate);
const filepath = join(STORIES_DIR, filename);
const content = createStoryContent(item);

try {
await writeFile(filepath, content, 'utf-8');
console.log(`Created: ${filename}`);
createdCount++;
} catch (error) {
console.error(`Error creating ${filename}:`, error.message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants