| title | Creating Custom Feeds | ||
|---|---|---|---|
| description | Learn to write custom YAML configurations for RSS feeds when auto-sourcing isn't enough. | ||
| sidebar |
|
import { Aside, Code } from "@astrojs/starlight/components";
When auto-sourcing isn't enough, you can write your own configuration files to create custom RSS feeds for any website. This guide shows you how to take full control with YAML configs.
Prerequisites: You should be familiar with the Getting Started guide before diving into custom configurations.
Start with included feeds first. If your site is not covered, try [automatic feed generation](/web-application/how-to/use-automatic-feed-generation/) next. Reach for a custom config when you need a stable, reviewable setup or the generated feed misses important content.Use custom configs when:
- Auto-sourcing doesn't work for the website you want to follow
- Existing feeds are incomplete or missing important content
- You need specific formatting or data extraction
- The website has complex structure that requires custom selectors
- You want to combine data from multiple sources
Don't need custom configs? Check the Feed Directory first - there might already be a working feed for your website.
- Inspect the live page in your browser developer tools
- Write the smallest useful config that extracts items, titles, and links
- Validate the config with
html2rss validate your-config.yml - Render the feed with
html2rss feed your-config.yml - Add it to
html2rss-webso you can use it through your normal instance - Escalate request strategy when needed: use a browser-based rendering strategy only when troubleshooting requires it
This order keeps iteration fast and makes it easier to see whether the problem is the page structure, your selectors, or the fetch strategy.
A config file is a simple "recipe" that tells html2rss:
- Which website to look at
- What content to find
- How to organize it into an RSS feed
This tells html2rss basic information about your feed - like giving it a name and telling it which website to look at.
Example:
<Code
code={channel: url: https://example.com/blog title: My Awesome Blog}
lang="yaml"
/>
This says: "Look at this website and call the feed 'My Awesome Blog'"
This is where you tell the html2rss engine exactly what to find on the page. You use CSS selectors (like you might use in web design) to point to specific parts of the webpage.
Example:
<Code
code={selectors: items: selector: "article.post" title: selector: "h2 a" link: selector: "h2 a" attribute: href}
lang="yaml"
/>
This says: "Find each article, get the title from the h2 anchor, and get the link from the same h2 anchor's href attribute"
Need more details? Check our complete guide to selectors for all the options.
Step 1: Inspect the website you want to create a feed for. Start with your browser's developer tools to inspect the live DOM. "View Page Source" can still help, but it may miss JavaScript-rendered content.
Step 2: Create a file called example.com.yml with this basic structure:
<Code code={ "channel:\n" + " url: https://example.com/blog\n" + " title: My Blog\n" + "\n" + "selectors:\n" + " items:\n" + ' selector: "article.post"\n' + " title:\n" + ' selector: "h2 a"\n' + " link:\n" + ' selector: "h2 a"\n' + " attribute: href" } lang="yaml" />
Step 3: Test it with your html2rss-web instance or the Ruby gem.
Need help? See our troubleshooting guide for common issues.
html2rss supports many configuration options:
- Basic selectors for title, description, and links
- Advanced features like custom headers and dynamic parameters
- Multiple strategies for different types of websites
- Post-processing to clean up extracted content
See our Ruby Gem Reference for complete documentation.
Before sharing your config, test it:
- Validate the config first:
<Code code={html2rss validate your-config.yml} lang="bash" />
- Then render the feed with the Ruby gem:
<Code code={html2rss feed your-config.yml} lang="bash" />
-
Test with
html2rss-web: Add your config to thefeeds.ymlfile and restart your instance -
Check the output: Make sure all items have titles, links, and descriptions
Some sites need a little more request budget than the defaults.
- Use
--max-redirectswhen the site bounces through several canonicalization or tracking redirects before the real page loads. - Use
--max-requestswhen your config needs more than one request, for example pagination or other follow-up fetches.
<Code
code={html2rss feed your-config.yml --max-redirects 10 && \ html2rss feed your-config.yml --max-requests 5 && \ html2rss auto https://example.com/blog --max-redirects 10 --max-requests 5}
lang="bash"
/>
Keep these values tight. Raise them only when the site proves it needs more.
Once the config works locally, add it to your feeds.yml or shared config repository and restart your
instance. Then open the feed through your normal html2rss-web URL and confirm it behaves the same way
there.
Help the community by sharing your config:
- Go to html2rss-configs on GitHub
- Click "Fork" → "Add file" → Create
domain.com.yml - Paste your config → "Commit new file" → "Open pull request"
Need help? See our contribution guide for detailed instructions.
Common issues when writing configs:
- No items found? Check your selectors with browser tools (F12) - the
items.selectormight not match the page structure - Invalid YAML? Use spaces, not tabs, and ensure proper indentation
- Website not loading? Check the URL and try accessing it in your browser
- Missing content? Try a browser-based rendering strategy during troubleshooting
- Wrong data extracted? Verify your selectors are pointing to the right elements
Need more help? See our comprehensive troubleshooting guide or ask in GitHub Discussions.
🎉 Congratulations! You've learned the basics of creating html2rss configuration files.
For Beginners:
- Browse the Feed Directory - See real-world examples
- Run html2rss-web with Docker - Use the newest integrated behavior
- Learn more about selectors - Master CSS selectors
- Submit your config via GitHub Web - No Git knowledge required!
For Contributors:
- Browse existing configs - See real examples
- Join discussions - Connect with other users
- Learn about strategies - Decide when to use static vs JavaScript/browser-based extraction
- Learn advanced features - Take your configs to the next level