cinatic / stocks-extension

A extension to display stock quotes in GNOME Shell Panel
GNU General Public License v3.0
85 stars 31 forks source link

Yahoo API not working #88

Closed Cubuss closed 6 months ago

Cubuss commented 1 year ago

image

cinatic commented 1 year ago

~yahoo decided to close their API for now~

yahoo decided to restrict the access to their v8 quote API

image

Cubuss commented 1 year ago

yahoo decided to close their API for now

east money also doesn't seem to work? are you gonna add a alternative option?

bionicdude commented 1 year ago

Hopefully we can move to an alternative provider. i didn't realise how much i would miss not having this in my notification bar..

eddelbuettel commented 1 year ago

Another project I use (and which is R based) switched to JSON endpoint recently. That still works, There are/were two endpoints, v6 and v7 and the v6 one I understand is off now / had GDPR issues in Europe.

Full discussion (with many comments and links to other implementation in other languages) is at https://github.com/joshuaulrich/quantmod/issues/382

rykdesjardins commented 1 year ago

I also noticed the Yahoo website currently uses the v8/finance/chart endpoint, and the response includes both historical and current market prices. It is also unauthenticated.

https://query1.finance.yahoo.com/v8/finance/chart/ETH-USD?region=CA&lang=en-CA&includePrePost=false&interval=2m&useYfid=true&range=1d&corsDomain=ca.finance.yahoo.com&.tsrc=finance

Otherwise, it seems the endpoints currently used by this repo only really need a cookie from Yahoo -- or "crumb" -- which can be easily obtained however I'm not sure how ethical / convoluted that would be.

Edit: I'd be happy to open a PR if we're OK moving to the v8/finance/chart endpoint. It would require changing a constant and a DTO mapper.

cinatic commented 1 year ago

@Cubuss highly regarded portfolio =)

@rykdesjardins oddly, the charts endpoint was and is still working for me, it uses the v10 ...

@eddelbuettel thanks for the hint, i changed the quote endpoint, would be great if someone could test it too

https://github.com/cinatic/stocks-extension/commit/6224abf9da42d7984a670eaa3b7dd496a4d37d34 https://github.com/cinatic/stocks-extension/releases/download/v31/stocks-extension.zip

Cubuss commented 1 year ago

@Cubuss highly regarded portfolio =)

@rykdesjardins oddly, the charts endpoint was and is still working for me, it uses the v10 ...

@eddelbuettel thanks for the hint, i changed the quote endpoint, would be great if someone could test it too

6224abf https://github.com/cinatic/stocks-extension/releases/download/v31/stocks-extension.zip

working and im in europe to

eddelbuettel commented 1 year ago

I'd love but I am too much of a newb when it comes to gnome-extensions. Nearly 30 years of Linux but this is a wee bit outside my depth. Hint?

(I unzip'ed, I tried to enable, no mas.)

Cubuss commented 1 year ago

I'd love but I am too much of a newb when it comes to gnome-extensions. Nearly 30 years of Linux but this is a wee bit outside my depth. Hint?

(I unzip'ed, I tried to enable, no mas.)

drop the folder in /home/yourusernamehere/.local/share/gnome-shell/extensions and rename the folder to stocks@infinicode.dethen restart gnome or reboot

piorkov commented 1 year ago

@Cubuss

As far as I can see, the new versions of this extension support gnome 43 and 44. I am using Ubuntu 22.04 LTS with Gnome 42. Is there a chance that this will work, or do I have to manually add a patch to the latest compatible version ?

cinatic commented 1 year ago

@piorkov what extension version do you use?

eddelbuettel commented 1 year ago

drop the folder in /home/yourusernamehere/.local/share/gnome-shell/extensions and rename the folder to stocks@infinicode.de

Yes did all that and fiddled with the browser-based control as well as with gnome-extension

then restart gnome or reboot

No chance I reboot and I loathe rearranging all my desktop sessions. Now I remember I save a script for this it has busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting...")' which didn't work now (don't you love how Gnome changes this every couple of months?) but it also had (commented out) killall -HUP gnome-shell and that did the job.

Back in business. Amazeballs. Thanks so much! Glad the hint was helpful.

piorkov commented 1 year ago

@cinatic version 24, Based on https://extensions.gnome.org/extension/1422/stocks-extension/ is the last compatible version for gnome 42

cinatic commented 1 year ago

i tried to upload a 42 version but i am too stupid now to understand how the versioning exactly works when targeting divergent shell versions.

this should work for 42 stocks-extension.zip

brent80 commented 1 year ago

extension version 24 gnome version 42.5 I switched to eastmoney and it seems to be working for me example Screenshot from 2023-07-14 11-36-37

piorkov commented 1 year ago

@cinatic you forgot to add in this zip this object: createQuoteSummaryFromYahooDataV6 I had to bump up the versions to 25 because it's now 23 there and it's trying to update me to the official version 24 after these changes it works for me :)

Fixed version: stocks@infinicode.de.zip

@brent80 I tried to use this for INTC but it didn't work for me :( hmm, I guess I don't know how to use estmoney

brent80 commented 1 year ago

@piorkov That worked for me, you have to look them up kinda difficult at https://www.eastmoney.com And find the correct link

Screenshot from 2023-07-14 11-52-19

piorkov commented 1 year ago

@brent80, you are right eastmoney also works, but yahoo works better for me

lon9man commented 1 year ago

@cinatic i replaced gnome-extension folder with stocks@infinicode.de.zip

OS Ubuntu 20.04 it started work, but when i press gear-icon it shows error image

eeclarkjr commented 1 year ago

@Cubuss highly regarded portfolio =)

@rykdesjardins oddly, the charts endpoint was and is still working for me, it uses the v10 ...

@eddelbuettel thanks for the hint, i changed the quote endpoint, would be great if someone could test it too

6224abf https://github.com/cinatic/stocks-extension/releases/download/v31/stocks-extension.zip

this version was downloaded and appears to be working here in USA : Fedora 38

cinatic commented 1 year ago

eastmoney also works for me (except charts, but this is a different case) so everything should be okay now, thanks everybody

@lon9man this is probably a gnome-shell version miscompatiblity, which shell version do you have?, if 42 you can try the version @piorkov provided otherwise you would need to patch it yourself

bionicdude commented 1 year ago

I'm in gnome 42.9 and tried piorkov's zip. Seems to work ok for me..

christopher-henderson commented 1 year ago

+1 to the zip uploaded by @piorkov working on Ubuntu 22. Thank you!

lukibeni commented 1 year ago

The uploaded zip by @piorkov (thanks!) working for me on Ubuntu 20.04, but I also get error when try to open settings. @cinatic When should I expect a working version from extensions.gnome.org?

piorkov commented 1 year ago

@lukibeni What kind of error are you observing, gnome-shell extensions-perf command not found? In my case it is just this command not found , but as WA I can enter the settings using gnome extension manager.

I suspect that the new version for gnome 42 will not appear on extensions.gnome.org, but I hope I'm wrong

lukibeni commented 1 year ago

@piorkov this si the error I got, same from the settings button of the overlay and from the Gnome Tweak Tools settings: image

Error: Requiring Adw, version none: Typelib file for namespace 'Adw' (any version) not found

Stack trace:
  @/home/blukacs/.local/share/gnome-shell/extensions/stocks@infinicode.de/components/settings/aboutPage.js:4:53
  @/home/blukacs/.local/share/gnome-shell/extensions/stocks@infinicode.de/prefs.js:6:23
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:204:33
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
piorkov commented 1 year ago

@lukibeni Ubuntu 20.04 by default has GNOME 3.36. I assume that your problem may be related to the fact that this extension does not support such an old gnome so the Adw library is missing. The same problem on Ubuntu 20.04 has @lon9man

lon9man commented 1 year ago

@lukibeni i updated version for Ubuntu 20.04 you can try it here: stocks-extension-19.1.zip

lukibeni commented 1 year ago

Thanks @lon9man, but this version doesn't works for me at all :( I copied the stocks@infinicode.de folder to ~/.local/share/gnome-shell/extensions, but the Gnome Tweak app shows an error for me, and the settings page shows this error (No such file or folder): image

lon9man commented 1 year ago

@lukibeni i added gschemas.compiled into repository. please re-download stocks-extension-19.1.zip and repeat test

lukibeni commented 1 year ago

@lon9man thanks, it works now!

cesaric commented 1 year ago

@lon9man, works on gnome 42. Updated metadata.json (so that extensions wouldn't prompt me to update it) Thanks!:

{
  "_generated": "Generated by SweetTooth, do not edit",
  "description": "Stocks Extension brings stock quotes to your GNOME Shell Panel",
  "localedir": "/usr/local/share/locale",
  "name": "Stocks Extension",
  "shell-version": [
    "3.32",
    "3.34",
    "3.36",
    "3.38",
    "40",
    "42"
  ],
  "url": "https://github.com/cinatic/stocks-extension",
  "uuid": "stocks@infinicode.de",
  "version": 24
t3rmin4l commented 1 year ago

@lukibeni i added gschemas.compiled into repository. please re-download stocks-extension-19.1.zip and repeat test

You are a beautiful human being!!! Thank you!

techconsulter commented 1 year ago

@lon9man Thx works again

ashes00 commented 1 year ago

This is a wonderful extension, and I have been following this thread for 3 weeks after the Yahoo API change. I see some are saying its working, however I still have a broken extension. Should the ext not auto update with any changes, or are the fixes still in testing? Thanks in advance to all that work on this project!
~ Ash

lon9man commented 1 year ago

@ashes00 You should detect Gnome version you are using.

If 42 (Ubuntu 22.04) - then piorkov version should work. If 3.36 (Ubuntu 20.04) - then lon9man version should work.

I am not sure that you can easily update version using site extensions.gnome.org, but you can do it manually.

Take chosen version from github and replace folder in /home/yourusernamehere/.local/share/gnome-shell/extensions with appropriate part of sources

ashes00 commented 1 year ago

@lon9man Thanks for the heads up. Apparently I grabbed the wrong .zip last time. I was able to use the piorkov version .zip, and its working perfectly. Thank you so very much!

TalZiv commented 1 year ago

Hi,

I have downloaded @piorkov fixed version https://github.com/cinatic/stocks-extension/issues/88#issuecomment-1636111871, But I still get unauthorized with Yahoo and EastMoney.

The graph works but not the numbers.

I am using PopOs 22.04 with Gnome 42.5

Any help would be appriciated.

Eric-Bwr commented 1 year ago

@TalZiv I have the same issue.

Is there any good other provider we could use?

tsilvs commented 1 year ago

Maybe an alternative implementation would work?

cinatic commented 1 year ago

@stieg created a backport for Gnome Shell 42.x , the package can be found here: https://github.com/cinatic/stocks-extension/releases/tag/v24.1

dal00 commented 1 year ago

It is broken again for me. Anybody else seeing this? image

cinatic commented 1 year ago

It is, with the next version it's implemented a bit different https://github.com/cinatic/stocks-extension/pull/92/commits/61a67962524d47f8f0b7448dee0780daf54560c3

eljefe6a commented 1 year ago

@cinatic I just installed v32, and it's still hitting the Yahoo v6 API. I uninstalled and reinstalled it. Still no joy.

dal00 commented 1 year ago

@cinatic I just installed v32, and it's still hitting the Yahoo v6 API. I uninstalled and reinstalled it. Still no joy.

But the next version which is linked by @cinatic is v33

cinatic commented 1 year ago

i prepared packages for older gnome-shell versions containing the new api handling:

https://github.com/cinatic/stocks-extension/releases/tag/v24.2-GS42 https://github.com/cinatic/stocks-extension/releases/tag/v32-GS43_44

the latest version for GS45 is https://github.com/cinatic/stocks-extension/releases/tag/v33 which is except a format fix the same as v32. Just make sure you have the right version installed (v32 or v33)

eddelbuettel commented 1 year ago

Git pull'ed, and copied from the 43_44 branch, but now get run-time error:

GLib.FileError: Failed to open file “/home/edd/.local/share/gnome- shell/extensions/stocks@infinicode.de/schemas/gschemas.compiled”: open() failed: No such file or directory

I am on Ubuntu 23.04 with GS 44.

stieg commented 12 months ago

Same issue with v24.2-GS42 branch:

GLib.FileError: Failed to open file “/home/stieg/.local/share/gnome-shell/extensions/stocks@infinicode.de/schemas/gschemas.compiled”: open() failed: No such file or directory

cinatic commented 12 months ago

hard to tell what might be the problem, i tried the packages on fresh vm instances, without having a problem

the GS 42 pkg on ubutntu21.04 the GS 43/44 pkg on debian12

how exactly are you installing these packages? make install or downloading the release packages?

stieg commented 12 months ago

how exactly are you installing these packages? make install or downloading the release packages?

$ git fetch origin && git reset --hard v24.2-GS42 && <Copy to my local directory>