alexanderepstein / Bash-Snippets

A collection of small bash scripts for heavy terminal users
MIT License
9.64k stars 842 forks source link

Stock script returns "Not a valid stock symbol" #211

Closed mathtd closed 4 years ago

mathtd commented 4 years ago

Issue Label:

Description: Looking for the price of AAPL returns "Not a valid stock symbol"

stocks AAPL
AAPL: Not a valid stock symbol

If its a bug make sure to include this section.

OS and OS version:

OS Version: macOS Catalina 10.15.2

alexanderepstein commented 4 years ago

Are you running version 1.23.0? try running stocks -u

mathtd commented 4 years ago

Yes 1.23.0.

stocks -u AAPL
Bash-Snippets is already the latest version

If I run bash -x stocks AAPL it seems that the problem comes from:

++ curl -A curl -s https://financialmodellingprep.com/api/v3/company/profile/AAPL
+ stockProfile='<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.14.0 (Ubuntu)</center>
</body>
'/html>
ghost commented 4 years ago

Try 'curl -sL ..'

On Wed, 8 Jan 2020, 15:03 mathtd, notifications@github.com wrote:

Yes 1.23.0.

stocks -u AAPL Bash-Snippets is already the latest version

If I run bash -x stocks AAPL it seems that the problem comes from:

++ curl -A curl -s https://financialmodellingprep.com/api/v3/company/profile/AAPL

  • stockProfile=' 301 Moved Permanently

    301 Moved Permanently


    nginx/1.14.0 (Ubuntu)

    '/html>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alexanderepstein/Bash-Snippets/issues/211?email_source=notifications&email_token=AJKJVN5E272LLCRNBRUH7Y3Q4YIPTA5CNFSM4KELAX52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEINOB6I#issuecomment-572186873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJKJVN563PBHZSP52W5YD4LQ4YIPTANCNFSM4KELAX5Q .

mathtd commented 4 years ago

That works!

alexanderepstein commented 4 years ago

So it seems the endpoint must have changed, will update the Stocks component with the new endpoint

alexanderepstein commented 4 years ago

Seems like they changed the URL from https://financialmodellingprep.com -> https://financialmodelingprep.com, I pushed a fix in bb561e5048d07b6709192896b37fef32059da16f and will release an update soon. Thanks for making me aware of the issue! If you want the changes now, you can rerun the git install steps and skip the step of checking out to the latest stable build.

mathtd commented 4 years ago

Great, thank you!