DEV Community


Posted on • Updated on

Telescope -filtering feed URLs - release

This week, I finished implementing the feature for filtering out irrelevant feed URLs. Previously, I had added a function for the filtering but had to write the test for it.

As I started writing tests for different feed URLs from different hosts, I noticed that I had missed a few cases. These were the links of type json+oembed returned by, and a link returned by with a rel attribute value of From what I was able to find, this kind of link can be used for adding posts/feeds to the feed. So, I added more filters for these as well.

After some refactoring and testing different regular expressions, I ended up with three filters to handle all irrelevant URLs:

  • /\/comments\/feed\/$/
  • /^https:\/\/\/oembed/
  • /^https:\/\/\/feeds\/[0-9]*\/posts\/default$/

The first filter here handles the comments feed from I did not specify wordpress in the regular expression since it would fail if a user had a custom blog URL. However, for the second and third filters, we can specify the blog host as they specify the blog as a query param and a numeric id respectively.

Following that, I had to add more tests, resolve some merge conflicts and do more testing to ensure that the relevant feed URLs were returned for different blog hosts. Once I confirmed that everything worked correctly, I created a PR.

Top comments (0)