Aggiunti nuovi script demo per i provider di mercato e rimosso codice obsoleto
This commit is contained in:
16
demos/api_news_providers.py
Normal file
16
demos/api_news_providers.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from dotenv import load_dotenv
|
||||
from app.api.tools import NewsAPIsTool
|
||||
|
||||
def main():
|
||||
api = NewsAPIsTool()
|
||||
articles_aggregated = api.get_latest_news_aggregated(query="bitcoin", limit=2)
|
||||
for provider, articles in articles_aggregated.items():
|
||||
print("===================================")
|
||||
print(f"Provider: {provider}")
|
||||
for article in articles:
|
||||
print(f"== [{article.time}] {article.title} ==")
|
||||
print(f" {article.description}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
load_dotenv()
|
||||
main()
|
||||
Reference in New Issue
Block a user