Filter date articles for all methods#106
Open
v-cardona wants to merge 3 commits into
Open
Conversation
ranahaani
requested changes
Oct 23, 2024
| def _process(self, item): | ||
| url = process_url(item, self._exclude_websites) | ||
| if url: | ||
| if url and (inspect.stack()[2][3] == 'get_news' or inspect.stack()[2][3] == 'get_news_by_site' or self._is_date_in_range(item.get("published", ""))): |
Owner
There was a problem hiding this comment.
Hey @v-cardona can you please add test cases for this chnage? also can you please update README.md with example?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Filter the news by date of the methods that do not support it, all of them except for ‘get_news(keyword’) and get_news_by_site(site)
In case the user has set the start_date, end_date or period, once the news is obtained, it is compared with the interval and if programmatically the news is added or not to the array of results.
If you do not want to use this method, simply do not specify a date value, or leave it to None.