Update app.py
Browse files
app.py
CHANGED
|
@@ -13,8 +13,8 @@ signs = [
|
|
| 13 |
]
|
| 14 |
|
| 15 |
def get_trending_news():
|
| 16 |
-
"""Fetch and return trending news headlines."""
|
| 17 |
-
url = f"http://newsapi.org/v2/top-headlines?country=
|
| 18 |
try:
|
| 19 |
page = requests.get(url).json()
|
| 20 |
articles = page["articles"]
|
|
@@ -79,7 +79,7 @@ def update_all(sign):
|
|
| 79 |
]
|
| 80 |
|
| 81 |
current_date = datetime.now().strftime("%d %b %Y")
|
| 82 |
-
news = create_section("📰 Trending News", get_trending_news(), random.choice(colors))
|
| 83 |
horoscope = create_section("✨ Horoscope", get_horoscope(sign), random.choice(colors))
|
| 84 |
history = create_section("📅 On This Day", get_history_today(), random.choice(colors))
|
| 85 |
|
|
|
|
| 13 |
]
|
| 14 |
|
| 15 |
def get_trending_news():
|
| 16 |
+
"""Fetch and return trending Technology news headlines."""
|
| 17 |
+
url = f"http://newsapi.org/v2/top-headlines?country=us&&category=technology&apiKey={HF_API_KEY}"
|
| 18 |
try:
|
| 19 |
page = requests.get(url).json()
|
| 20 |
articles = page["articles"]
|
|
|
|
| 79 |
]
|
| 80 |
|
| 81 |
current_date = datetime.now().strftime("%d %b %Y")
|
| 82 |
+
news = create_section("📰 Trending Tech News", get_trending_news(), random.choice(colors))
|
| 83 |
horoscope = create_section("✨ Horoscope", get_horoscope(sign), random.choice(colors))
|
| 84 |
history = create_section("📅 On This Day", get_history_today(), random.choice(colors))
|
| 85 |
|