diff --git a/openbb_terminal/common/newsapi_view.py b/openbb_terminal/common/newsapi_view.py index dcd529bb4f4f..fe48ce54726a 100644 --- a/openbb_terminal/common/newsapi_view.py +++ b/openbb_terminal/common/newsapi_view.py @@ -3,10 +3,12 @@ import logging +import pandas as pd + from openbb_terminal.decorators import check_api_key from openbb_terminal.common import newsapi_model from openbb_terminal.decorators import log_start_end -from openbb_terminal.rich_config import console +from openbb_terminal.helper_funcs import print_rich_table logger = logging.getLogger(__name__) @@ -16,7 +18,7 @@ def display_news( term: str, s_from: str, - num: int = 5, + num: int = 3, show_newest: bool = True, sources: str = "", ): @@ -39,13 +41,17 @@ def display_news( if articles: for idx, article in enumerate(articles): - console.print( - article["publishedAt"].replace("T", " ").replace("Z", ""), - " ", - article["title"], - ) # Unnecessary to use name of the source because contained in link article["source"]["name"] - console.print(article["url"], "\n") + data = [ + [article["publishedAt"].replace("T", " ").replace("Z", "")], + [f"{article['description']}"], + [article["url"]], + ] + + table = pd.DataFrame( + data, index=["published", "content", "link"], columns=["Content"] + ) + print_rich_table(table, title=article["title"]) if idx >= num - 1: break diff --git a/openbb_terminal/stocks/stocks_controller.py b/openbb_terminal/stocks/stocks_controller.py index 831f38b8efde..e6a5885f52c3 100644 --- a/openbb_terminal/stocks/stocks_controller.py +++ b/openbb_terminal/stocks/stocks_controller.py @@ -427,7 +427,7 @@ def call_news(self, other_args: List[str]): ) if other_args and "-" not in other_args[0][0]: other_args.insert(0, "-l") - ns_parser = self.parse_known_args_and_warn(parser, other_args, limit=5) + ns_parser = self.parse_known_args_and_warn(parser, other_args, limit=3) if ns_parser: sources = ns_parser.sources for idx, source in enumerate(sources): diff --git a/website/content/terminal/stocks/news/_index.md b/website/content/terminal/stocks/news/_index.md index 1982ea0627ce..717fe13ad39a 100755 --- a/website/content/terminal/stocks/news/_index.md +++ b/website/content/terminal/stocks/news/_index.md @@ -18,21 +18,47 @@ optional arguments: Example: ``` -2022 Feb 16, 08:33 (β¨) /stocks/ $ news -256 news articles for Amazon.com,+Inc. were found since 2022-02-09 +2022 Jul 04, 16:54 (π¦) /stocks/ $ news +543 news articles for Apple+Inc. were found since 2022-06-27 -2022-02-16 13:06:33 ViacomCBS renames itself Paramount -https://www.livemint.com/industry/media/viacomcbs-renames-itself-paramount-11645016266083.html -2022-02-16 13:00:34 Low-code development startup Genesis raises $200M round led by Tiger Global -https://siliconangle.com/2022/02/16/low-code-development-startup-genesis-raises-200m-round-led-tiger-global/ + Three ways to patch your thinking about open-source software security +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ +β Content β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ +β 2022-07-04 20:11:03 β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ +β What comes to mind when you hear βopen source?β Is it a community? Better-quality software? A technology advantage β +β that helps companies scale quickly? If so, congratulations. You understand the value developing with open-source β +β software can bring to a businessβ¦ β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ +β https://siliconangle.com/2022/07/04/three-ways-patch-thinking-open-source-software-security/ β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -2022-02-16 12:45:00 Ireland Prepaid Card and Digital Wallet Market Report 2022: Market is Expected to Record a CAGR of 10.9%, Increasing from US$2.74 Billion in 2022 to Reach US$4.15 Billion by 2026 -https://www.prnewswire.com/news-releases/ireland-prepaid-card-and-digital-wallet-market-report-2022-market-is-expected-to-record-a-cagr-of-10-9-increasing-from-us2-74-billion-in-2022-to-reach-us4-15-billion-by-2026--301483505.html -2022-02-16 12:45:00 Ireland Prepaid Card and Digital Wallet Market Report 2022: Market is Expected to Record a CAGR of 10.9%, Increasing from US$2.74 Billion in 2022 to Reach US$4.15 Billion by 2026 -https://finance.yahoo.com/news/ireland-prepaid-card-digital-wallet-124500072.html + HUUUGE, INC.: Informacja o kwartalnych przychodach ze sprzedaΕΌy +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ +β Content β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ +β 2022-07-04 18:55:11 β +βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ +β Spis treΕci:1. RAPORT BIEΕ»ΔCY2. MESSAGE (ENGLISH VERSION)3. INFORMACJE O PODMIOCIE4. PODPISY OSΓB REPREZENTUJΔCYCH β +β SPΓΕKΔ KOMISJA NADZORU FINANSOWEGO