File size: 914 Bytes
b029173 601d9f9 493ea8d 601d9f9 b029173 601d9f9 b029173 493ea8d 601d9f9 b029173 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# nuse_modules/fetch_headline_articles.py
from nuse_modules.google_search import search_google_news_batch
def fetch_headline_articles():
queries = [
"India news", "US politics", "UK elections", "China economy",
"Tech layoffs", "Ukraine war", "AI regulation", "Africa development",
"South America inflation", "Global stock markets", "Climate change",
"Middle East", "EU summit", "Canada economy", "Australia news",
"Russia sanctions", "Elections 2025", "Big tech", "Trade wars",
"Global protests", "Public health", "Oil prices", "Space news",
"Cryptocurrency", "Cybersecurity"
]
print("[INFO] Fetching news articles from Google Custom Search...")
articles = search_google_news_batch(queries, results_per_query=30) # 30 per query × 25 queries = ~750 raw
print(f"[INFO] Retrieved {len(articles)} unique articles.")
return articles
|