Skip to content

Commit

Permalink
Fixed the google issue
Browse files Browse the repository at this point in the history
  • Loading branch information
izdrail committed Jan 18, 2023
1 parent 2dc300b commit db2a193
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class PostAction(BaseModel):
class FeedReader(BaseModel):
link: str

class GoogleNews(BaseModel):
class GoogleNewsAction(BaseModel):
keyword: str
language: str

Expand Down Expand Up @@ -112,9 +112,9 @@ async def root():

#Todo Improve this
@app.post("/google-news")
async def root(google: GoogleNews):
googlenews = GoogleNews(lang=google.language, period='7d')
googlenews.search(google.query)
async def root(google: GoogleNewsAction):
googlenews = GoogleNews(lang=""+google.language+"", period='7d')
googlenews.search(google.keyword)
return {"data": {
"keyword": google.keyword,
"response": googlenews.results(),
Expand Down

0 comments on commit db2a193

Please sign in to comment.