Skip to content

Commit 8111ab6

Browse files
authored
Add documentation for feed filters and usage example (#267)
1 parent 32d9fe6 commit 8111ab6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ For sorting on updated date instead of publication date
7878
.sorted(ItemComparator.oldestUpdatedItemFirst())
7979
```
8080

81+
### Feed Filters
82+
Feed filters allow you to clean or transform RSS feed data before it is parsed. This is useful for handling malformed content, removing invalid characters, or applying custom preprocessing logic.
83+
Filters are applied to the raw `InputStream` of the feed, allowing for flexible transformations before parsing begins. Each filter must implement the `FeedFilter` interface.
84+
For example, to remove invalid XML characters from a feed before parsing:
85+
```java
86+
RssReader reader = new RssReader();
87+
List<Item> items = reader.addFeedFilter(new InvalidXmlCharacterFilter())
88+
.read(URL)
89+
.collect(Collectors.toList());
90+
```
8191

8292
### Podcast / iTunes module
8393
Use iTunes module for extracting data from [Podcast][4] specific tags and attributes.

0 commit comments

Comments
 (0)