Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Period Object not working #55

Open
speenoo opened this issue Mar 8, 2023 · 2 comments
Open

Period Object not working #55

speenoo opened this issue Mar 8, 2023 · 2 comments

Comments

@speenoo
Copy link

speenoo commented Mar 8, 2023

Hello, when using the period function to limit dates it doesnt return any restults. Anyone have a fix?

@Shaun-Tan-DJ
Copy link

Shaun-Tan-DJ commented May 26, 2023

This isn't a fix to the codes, but manually making use of Google boolean search to limit dates.
Below is what I use for articles less than a week old,

import datetime
input_query = "{main_query} after:{after_date}"
main_query = "Lorax of the forest"
number_of_weeks = 1
after_date = (datetime.datetime.now()- datetime.timedelta(weeks=number_of_weeks )).strftime('%Y-%m-%d')
input_query = input_query.format(main_query=main_query, after_date=after_date)

df_results = google_news.get_news(input_query)

@themetalleg
Copy link

in general have a look here: News Catcher API

I just added " when:30d" for the last 30days to my keyword.

I think that there is a general problem with the date range functionality and it could be the solution for all those: #60, #43, #47, #48

In #48 also is explained that it might be a problem with pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants