feat: select publication date in split
filter
#85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the
split
filter is only able to generate a feed whose items has title, link, author, and description.However, the users can also benefit from having a field for publication date. The publication date field will allow the feed readers to sort by date, and also allow the items to be sorted correctly in the
merge
filter.This PR adds a new config field to the
split
filter nameddate_selector
to enable the users to select the publication date for each article. The selector is optional, and has the same syntax as other selector fields.One thing to note is that the code employs some heuristic to guess the publication date from the selected elements. The heuristic is as follows:
textContent
for valid date stringThe following formats are recognized valid date string:
1996-12-19T16:39:57-08:00
Thu, 19 Dec 1996 16:39:57 -0800
Here's an example using
date_selector
for extracting RSS feed for GitHub releases: