Spaces:
Sleeping
Sleeping
Sasmita Harini
commited on
Commit
·
5b51ef2
1
Parent(s):
aeb4a28
Run FastAPI as subprocess in app.py
Browse files
.DS_Store
CHANGED
|
Binary files a/.DS_Store and b/.DS_Store differ
|
|
|
utils.py
CHANGED
|
@@ -39,7 +39,7 @@ client = Groq(api_key="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"
|
|
| 39 |
|
| 40 |
# RSS Feeds
|
| 41 |
rss_feeds = [
|
| 42 |
-
# Technology-focused feeds
|
| 43 |
"https://feeds.bbci.co.uk/news/technology/rss.xml", # BBC Technology
|
| 44 |
"https://www.cnbc.com/id/19854910/device/rss/rss.html", # CNBC Tech
|
| 45 |
"https://www.theverge.com/rss/index.xml", # The Verge
|
|
@@ -50,24 +50,37 @@ rss_feeds = [
|
|
| 50 |
"https://www.wired.com/feed/rss", # Wired
|
| 51 |
"https://www.zdnet.com/news/rss.xml", # ZDNet News
|
| 52 |
"https://www.cnet.com/rss/news/", # CNET News
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
# Business and Finance feeds
|
| 55 |
"https://feeds.bbci.co.uk/news/business/rss.xml", # BBC Business
|
| 56 |
-
"https://www.cnbc.com/id/
|
| 57 |
"https://www.economist.com/business/rss.xml", # The Economist Business
|
|
|
|
|
|
|
| 58 |
"https://feeds.a.dj.com/rss/WSJcomUSBusiness.xml", # Wall Street Journal US Business
|
|
|
|
|
|
|
|
|
|
| 59 |
"https://finance.yahoo.com/news/rssindex", # Yahoo Finance News
|
|
|
|
|
|
|
| 60 |
"https://www.investing.com/rss/news.rss", # Investing.com News
|
| 61 |
|
| 62 |
-
# General news
|
| 63 |
"https://feeds.bbci.co.uk/news/rss.xml", # BBC News
|
| 64 |
"https://www.aljazeera.com/xml/rss/all.xml", # Al Jazeera
|
| 65 |
"https://www.theguardian.com/world/rss", # The Guardian World
|
| 66 |
"https://feeds.npr.org/1001/rss.xml", # NPR News
|
| 67 |
"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml", # NYT Home Page
|
| 68 |
-
"https://apnews.com/hub/business?format=rss", #
|
| 69 |
"https://feeds.washingtonpost.com/rss/business", # Washington Post Business
|
| 70 |
]
|
|
|
|
| 71 |
headers = {
|
| 72 |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
|
| 73 |
}
|
|
@@ -212,7 +225,7 @@ def get_coverage_differences(articles, company_name):
|
|
| 212 |
except json.JSONDecodeError as e:
|
| 213 |
return f"Error: Invalid JSON format - {str(e)}"
|
| 214 |
else:
|
| 215 |
-
return "Error: No JSON content found between ```json
|
| 216 |
except Exception as e:
|
| 217 |
return f"Error in Groq API call: {str(e)}"
|
| 218 |
|
|
|
|
| 39 |
|
| 40 |
# RSS Feeds
|
| 41 |
rss_feeds = [
|
| 42 |
+
# Technology-focused feeds (general tech news, some may cover Visa tech initiatives)
|
| 43 |
"https://feeds.bbci.co.uk/news/technology/rss.xml", # BBC Technology
|
| 44 |
"https://www.cnbc.com/id/19854910/device/rss/rss.html", # CNBC Tech
|
| 45 |
"https://www.theverge.com/rss/index.xml", # The Verge
|
|
|
|
| 50 |
"https://www.wired.com/feed/rss", # Wired
|
| 51 |
"https://www.zdnet.com/news/rss.xml", # ZDNet News
|
| 52 |
"https://www.cnet.com/rss/news/", # CNET News
|
| 53 |
+
"https://www.digitaltrends.com/feed/", # Digital Trends
|
| 54 |
+
"https://www.techmeme.com/feed.xml", # Techmeme
|
| 55 |
+
"https://www.technologyreview.com/feed/", # MIT Technology Review
|
| 56 |
+
"https://www.pcworld.com/feed", # PCWorld
|
| 57 |
+
"https://venturebeat.com/feed/", # VentureBeat
|
| 58 |
|
| 59 |
+
# Business and Finance feeds (more likely to cover Visa)
|
| 60 |
"https://feeds.bbci.co.uk/news/business/rss.xml", # BBC Business
|
| 61 |
+
"https://www.cnbc.com/id/10001147/device/rss/rss.html", # CNBC Business
|
| 62 |
"https://www.economist.com/business/rss.xml", # The Economist Business
|
| 63 |
+
"https://www.ft.com/companies/financials/rss", # Financial Times Financials (Visa-relevant)
|
| 64 |
+
"https://www.ft.com/rss/companies/technology", # Financial Times Tech Companies
|
| 65 |
"https://feeds.a.dj.com/rss/WSJcomUSBusiness.xml", # Wall Street Journal US Business
|
| 66 |
+
"https://www.forbes.com/money/feed/", # Forbes Money
|
| 67 |
+
"https://www.reuters.com/arc/outboundfeeds/business/?outputType=xml", # Reuters Business
|
| 68 |
+
"https://www.bloomberg.com/feed/podcasts/markets.xml", # Bloomberg Markets
|
| 69 |
"https://finance.yahoo.com/news/rssindex", # Yahoo Finance News
|
| 70 |
+
"https://www.nasdaq.com/feed/rssoutbound", # Nasdaq News
|
| 71 |
+
"https://www.marketwatch.com/rss/topstories", # MarketWatch Top Stories
|
| 72 |
"https://www.investing.com/rss/news.rss", # Investing.com News
|
| 73 |
|
| 74 |
+
# General news (reliable sources that may cover Visa)
|
| 75 |
"https://feeds.bbci.co.uk/news/rss.xml", # BBC News
|
| 76 |
"https://www.aljazeera.com/xml/rss/all.xml", # Al Jazeera
|
| 77 |
"https://www.theguardian.com/world/rss", # The Guardian World
|
| 78 |
"https://feeds.npr.org/1001/rss.xml", # NPR News
|
| 79 |
"https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml", # NYT Home Page
|
| 80 |
+
"https://apnews.com/hub/business?format=rss", # Associated Press Business
|
| 81 |
"https://feeds.washingtonpost.com/rss/business", # Washington Post Business
|
| 82 |
]
|
| 83 |
+
|
| 84 |
headers = {
|
| 85 |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
|
| 86 |
}
|
|
|
|
| 225 |
except json.JSONDecodeError as e:
|
| 226 |
return f"Error: Invalid JSON format - {str(e)}"
|
| 227 |
else:
|
| 228 |
+
return "Error: No JSON content found between ```json and ``` markers"
|
| 229 |
except Exception as e:
|
| 230 |
return f"Error in Groq API call: {str(e)}"
|
| 231 |
|