Update app.py
Browse files
app.py
CHANGED
@@ -3,21 +3,21 @@ from gnewsclient import gnewsclient
|
|
3 |
from datetime import datetime, timedelta
|
4 |
|
5 |
# Google ๋ด์ค ํด๋ผ์ด์ธํธ ์ด๊ธฐํ
|
6 |
-
client = gnewsclient.NewsClient()
|
7 |
|
8 |
# ์ง์๋๋ ๊ตญ๊ฐ ๋ชฉ๋ก
|
9 |
supported_countries = client.locations
|
10 |
|
11 |
def get_news(country, keyword):
|
12 |
-
# ๊ตญ๊ฐ ์ค์
|
13 |
client.location = country
|
14 |
-
client.
|
15 |
|
16 |
# ํ์ฌ ์๊ฐ ๊ธฐ์ค 24์๊ฐ ์ ์๊ฐ ๊ณ์ฐ
|
17 |
time_threshold = datetime.now() - timedelta(hours=24)
|
18 |
|
19 |
# ๋ด์ค ๊ฒ์
|
20 |
-
news_items = client.get_news(
|
21 |
|
22 |
# 24์๊ฐ ์ด๋ด์ ๋ด์ค๋ง ํํฐ๋งํ๊ณ ์ ๋ชฉ๊ณผ ๋งํฌ ์ถ์ถ
|
23 |
filtered_news = []
|
|
|
3 |
from datetime import datetime, timedelta
|
4 |
|
5 |
# Google ๋ด์ค ํด๋ผ์ด์ธํธ ์ด๊ธฐํ
|
6 |
+
client = gnewsclient.NewsClient(language='en', location='', topic='', max_results=10)
|
7 |
|
8 |
# ์ง์๋๋ ๊ตญ๊ฐ ๋ชฉ๋ก
|
9 |
supported_countries = client.locations
|
10 |
|
11 |
def get_news(country, keyword):
|
12 |
+
# ๊ตญ๊ฐ ๋ฐ ํค์๋ ์ค์
|
13 |
client.location = country
|
14 |
+
client.query = keyword
|
15 |
|
16 |
# ํ์ฌ ์๊ฐ ๊ธฐ์ค 24์๊ฐ ์ ์๊ฐ ๊ณ์ฐ
|
17 |
time_threshold = datetime.now() - timedelta(hours=24)
|
18 |
|
19 |
# ๋ด์ค ๊ฒ์
|
20 |
+
news_items = client.get_news()
|
21 |
|
22 |
# 24์๊ฐ ์ด๋ด์ ๋ด์ค๋ง ํํฐ๋งํ๊ณ ์ ๋ชฉ๊ณผ ๋งํฌ ์ถ์ถ
|
23 |
filtered_news = []
|