Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Polling RSS feeds without duplicates: what actually works

Reading one RSS feed is easy. Polling two hundred feeds every hour and getting each article exactly once is where the small problems start. Here is what I learned building a feed reader for automations. 1. Ask the server whether anything changed Most feed servers send an ETag or a Last-Modified header. Send them back on the next request and an unchanged feed answers 304 Not Modified with an empty…

Checking for updates on numerous RSS feeds can be challenging. When managing over two hundred feeds that are polled every hour, ensuring each article is delivered only once presents significant challenges. Here are the key lessons learned while creating an automated feed reader.

First, request from the server if any changes have occurred. Many servers send an ETag or Last-Modified header. On subsequent requests, include this information using If-None-Match or If-Modified-Since headers. If the server responds with a 304 Not Modified status, indicating no new content, no items are downloaded. This approach is not only polite to the content provider but also reduces most of the workload when dealing with a large list of feeds.

Second, identify articles by their unique identifier, typically the guid in RSS or id in Atom. If these are not available, use the link as a stable reference. When identifiers are absent, utilize the combination of title and publication date. Remember to store the identifiers you have already delivered for each feed and compare them to avoid duplicates. Do not solely rely on "published after my last run" as the only test. Some feeds lack dates, some may include past dates, and clocks can vary.

Third, only save information that has been verified as safely stored. Create the list of already seen items after storing the new items, not before. If the process is interrupted during execution, the missing items will not be retrieved upon the next run, effectively eliminating them. Removing duplicates can be done later, but once an item is lost, it is gone forever.

Fourth, anticipate issues with broken XML. Different types of feeds, such as RSS 2.0, RSS 1.0 (RDF), Atom, and JSON Feed, can be mixed within a single feed. They may include HTML in CDATA sections or improper escaping, use relative links, employ out-of-date character sets, and present dates in multiple formats. A strict XML parser will struggle with many of these inconsistencies.

Fifth, when implementing keyword filters, ensure proper word boundaries. The initial approach matched "AI" within the word "available". To prevent false positives, filter for whole words and provide an explicit wildcard for endings. The feed reader package was named RSS Feed Reader, with the author as the creator. Users can input feed addresses or provide website URLs, allowing the system to locate the feed automatically.

They can select "only new items" and schedule the reader accordingly. During a test with eight different feed addresses, the first run retrieved 158 items, while the subsequent run performed a minute later returned zero results. Notably, four of the servers indicated "not modified". The service charges $0.30 for every 1,000 items returned.

Unchanged feeds, failed feeds, and items already delivered are free of charge. The reader is ready-to-run and ideal for obtaining new blog posts from competitor websites. For any feed that is not processed correctly, report its address for further assistance.

Rewritten by urgent.news; may contain errors — check the original. How we use AI.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

We track opens and clicks to improve the newsletter.

See today's edition · More options

More in Tech

More from Sunday, 6 December 2026 →