librehat / yapstocks

Yet Another Plasma Stocks Applet
GNU General Public License v3.0
22 stars 7 forks source link

No values displayed on widget #16

Closed abrasiveteapot closed 1 year ago

abrasiveteapot commented 1 year ago

Yapstocks has been working fine for years however now no longer displays the feed. Screenshot attached. Quite probably related to a version getting updated but not sure where to start testing to establish what the cause is.

image

System version levels:

https://old.reddit.com/r/kde/comments/13ehbyc/kde_widget_yapstocks_no_longer_displaying_values/jjptqh4/

KDE details

Operating System: Arch Linux

KDE Plasma Version: 5.27.5

KDE Frameworks Version: 5.105.0

Qt Version: 5.15.9

Kernel Version: 6.3.1-arch1-1 (64-bit)

Graphics Platform: Wayland

OS details

OS: Arch Linux x86_64

Kernel: 6.3.1-arch1-1

Packages: 1852 (pacman), 18 (flatpak)

Shell: bash 5.1.16

Resolution: 1920x1080

DE: Plasma 5.27.5

WM: kwin

WM Theme: Oxygen

Theme: Breeze Light [Plasma], Breeze [GTK3]

Icons: [Plasma], Relax-Light-Icons [GTK2/3]

qt5-charts version is 5.15.9-1

abrasiveteapot commented 1 year ago

Additional information of possible usefulness, the refresh button (top right) causes a brief blue circle to appear in the middle of the widget (indicating perhaps that it is pulling the data). Configuring the widget allows you to add new stocks and re-order/sort them. Last time this happened (a year ago roughly), changing the stock list reactivated it (not this time). Other widgets are working fine, and nothing else has broken that I've noticed.

librehat commented 1 year ago

Thanks for reporting this. I can confirm this is an issue.

It seems that the API to get the quotes is now throwing "Unauthorized" error.

Checking the Yahoo Finance website, it seems a valid "crumb" is now needed, which in turn needs a valid cookie.

I'll see if I can spare some time to fix this in the coming weeks.

igrekster commented 1 year ago

This workaround helped me: https://stackoverflow.com/questions/76059562/yahoo-finance-api-get-quotes-returns-invalid-cookie

I had the same issue today. Change the "v7" to "v6" in the URL in your GET request. It will then work, at least for now. Because the Yahoo Finance API hasn't been officially supported since 2017, we do what we can with it.

No charts, though.

MrLavender commented 1 year ago

Unfortunately v6 no longer works either since a couple of days ago, and it looks like that API is now completely dead for the foreseeable future.

https://stackoverflow.com/a/76333014

So I guess Yapstocks is dead too unless the data can be obtained somewhere else.

librehat commented 1 year ago

Unfortunately v6 no longer works either since a couple of days ago, and it looks like that API is now completely dead for the foreseeable future.

https://stackoverflow.com/a/76333014

So I guess Yapstocks is dead too unless the data can be obtained somewhere else.

In the code, there is this "resolveQuote" function that returns quote for a single symbol. Does that one still work? If that no longer works, agreed then this widget is dead :(

MrLavender commented 1 year ago

The endpoint in that function definitely works (for now) but I'm not a Javascript developer so don't know how to easily run and test the function itself.

E.g. https://query1.finance.yahoo.com/v10/finance/quoteSummary/MSFT?modules=price

librehat commented 1 year ago

The endpoint in that function definitely works (for now) but I'm not a Javascript developer so don't know how to easily run and test the function itself.

E.g. https://query1.finance.yahoo.com/v10/finance/quoteSummary/MSFT?modules=price

Thanks for confirming. I'll try to use that for now until they also kill it..

librehat commented 1 year ago

Please try v4.5

igrekster commented 1 year ago

Please try v4.5

Works for me -- thank you very much for fixing it.

abrasiveteapot commented 1 year ago

Please try v4.5

Working here as well. Thank you.

MrLavender commented 1 year ago

Working for me too, thanks!

abrasiveteapot commented 1 year ago

Minor bug in the display. The change in price is being marked as a percentage but displayed as decimal. I.e a $2.30 increase on a 215.70 base value is marked as 0.01% as opposed to 1%

image