Imported from rahul-patill/AI-News-Aggregator (
.agents/skills/add_scraper/SKILL.md). Install upstream withnpx skills add rahul-patill/AI-News-Aggregator --skill add_scraper. Copyright stays with the author.
Instructions for Adding a New Scraper
When the user asks to add a new scraper (e.g., Reddit, HackerNews, Twitter), follow these strict architectural guidelines:
- File Location: Create the new scraper in the
app/scrapers/directory. - Naming Convention: Name the file descriptively (e.g.,
reddit_scraper.py). - Class Structure:
- The scraper must be a class (e.g.,
RedditScraper). - It must implement a
fetch_articles(self) -> List[dict]method.
- The scraper must be a class (e.g.,
- Data Format: The dictionaries returned by
fetch_articlesMUST contain at minimum the following keys:id: A unique identifier (e.g., the URL or a hash).title: The title of the article/post.url: The link to the content.content: A brief snippet or description.
- Error Handling: The scraper must wrap external network calls in a
try/exceptblock. If the source is down, log the error and return an empty list[]to prevent crashing the pipeline. - Registration: After creating the scraper, you must import and initialize it inside the main orchestrator (usually
app/daily_runner.pyormain.py).