Your First Feed
Welcome to html2rss! This guide will walk you through creating your first RSS feed. We’ll start with the easiest method and gradually introduce more powerful options.
Step 1: The “No-Config” Method (auto)
Section titled “Step 1: The “No-Config” Method (auto)”The easiest way to create a feed is with the auto command. It requires no configuration file and intelligently scrapes the page to find content.
Open your terminal and run this command:
html2rss auto https://unmatchedstyle.com/html2rss will analyze the website and generate an RSS feed for you, printing it directly to the console. This is a great way to see if html2rss can automatically handle your target website.
Is the result not quite right? Let’s move to the next step.
Step 2: The “Full Control” Method (selectors)
Section titled “Step 2: The “Full Control” Method (selectors)”When you need to extract content with precision, the selectors scraper is the tool for the job. This method gives you complete control over what content is included in your feed by using CSS selectors.
Let’s create a feed for a simple article listing page.
-
Create a file named
example.yml. -
Add the following content:
channel:url: https://example.com/articlesselectors:items:selector: ".article-card"title:selector: "h2 a"url:selector: "h2 a"extractor: "href"description:selector: ".summary" -
Run the
feedcommand:Terminal window html2rss feed example.yml
This configuration tells html2rss:
- Each
.article-cardelement is one feed item. - The
titleis read from the link text insideh2. - The
urlis read from that link’shref. - The
descriptioncomes from the.summaryelement inside each card.
This is just the beginning! From here, you can dive deep into the full range of configuration options to create the perfect feed.