Yahoo Finance Quotes

UUID: yfquotes@thegli
Last edited:
2 days ago 2024-12-18, 14:57
Last commit: [107eae42] yfquotes@thegli: Update Catalan translation (#1372)

Displays financial market information such as stock quotes and commodity prices from Yahoo Finance

README

Close

Cinnamon Desklet for Yahoo Finance quotes

Description

This repository contains a desklet for the Cinnamon desktop environment that displays financial market information provided by Yahoo Finance.

Screenshot

This desklet is based on the desklet from fthuin. The data retrieval part is adopted to an alternative service url, after the Yahoo Finance community table got retired in May 2017.

Tested with

  • Linux Mint Cinnamon 17 up to 22
  • Debian 9 with Cinnamon 3.2
  • Manjaro with Cinnamon 3.8
  • Fedora 38 Cinnamon Spin with Cinnamon 5.6 and libsoup3

Installation

Either follow the installation instructions on Cinnamon spices (recommended), or manually download the directory yfquotes@thegli (below "files") and copy the directory and its content to ~/.local/share/cinnamon/desklets/

Configuration

Check out the desklet configuration settings, and choose the data refresh period, the list of quotes to show, and quote details to display. The default list contains the Dow 30 companies.

Note that manual changes in the quotes list are not immediately applied (anymore).
Press the "Refresh quotes data" button to execute an immediate data update, or wait until the next automatic refresh is triggered (depending on the configured interval).

Individual Quote Design

By default, all quotes in the list are rendered in the same style and color, following whatever settings are active and selected.
Optionally, the name and the symbol of each quote can have a custom design. These individual design settings override the global settings. They are configured with a set of text properties within the quotes list.

The design properties are appended to the quote symbol in the format property=value. Each property/value pair is separated by a semicolon. Also insert a semicolon between the quote symbol and the first property. The order of the properties is irrelevant.
The full syntax: SYMBOL;property1=value1;property2=value2

The following table explains all supported properties:

Property Values Description
color any CSS color value Text color for name and symbol
name any text, except ';' Custom name, overrides the original short/long name
style normal, italic, oblique Font style for name and symbol
weight normal, bold, bolder, lighter, 100 - 900 Font weight (thickness) for name and symbol

Some examples:

CAT;color=#f6d001;weight=500
CSCO;name=Cisco;weight=bold;color=#00bceb
HD;color=#f96300
MMM;name=Post-It Makers;color=#ff0000
IBM;name=Big Blue;color=blue;weight=bolder
KO;name=Bubbly Brown Water;style=oblique;weight=lighter;color=#e61a27

Troubleshooting

Problem: The desklet fails to load data, and shows error message "Status: 429 Too Many Requests".
Solution: Enable option Send custom User-Agent header found on the first tab "Quotes" in the configuration settings.

Debug Logging

Only enable debug logging in case of problems, and when you know why you need it!

The log output goes to the standard file ~/.xsession-errors. All log messages produced by this desklet contain "yfquotes@thegli", so we can filter by this text. By default, the desklet logs only abnormal situations.

Significantly more log output can be generated when the debug log mode is active.
To activate the debug log mode, create an empty file "DEBUG" in the desklet installation directory, e.g. with the command touch ~/.local/share/cinnamon/desklets/yfquotes@thegli/DEBUG
Then the Cinnamon desktop needs to be restarted in order to re-initialize the desklet. This can be done by pressing Ctrl-Alt-Esc, or by logout/login.

To disable the debug log mode, delete the "DEBUG" file, and restart the Cinnamon desktop.

Release Notes

See CHANGELOG

Credits

Based on the desklet source code from fthuin.

License

GNU General Public License v3.0

CHANGELOG

Open

Log In To Comment!

55 Comments

Gustavo Sobreiro de Assis
great desklets, thanks
Gerald Drißner
Gerald Drißner-1 year ago
Has anyone succeeded in making it work again? The user-agent-header did not fix it on my setup. I'd appreciate any workaround or fix. THANKS!
Thomas Egli
Thomas Egli-1 year ago
Hi Gerald It looks like Yahoo does triage requests based on device, and geolocation. The user-agent feature addresses only the former. Do you, by chance, reside in a EU country? (my bet would be Germany)
Heny67
Heny67-1 year ago
Hi Thomas! I know you didn't write to me, but if it helps, I live in Hungary.
Thomas Egli
Thomas Egli-1 year ago
Hi Heny67 Thank you for your reply. You confirm my assumption that the cause of the problem is a different routing of the requests. Apparently, EU citizens enjoy the pleasure of a cookie consent screen. Since the desklet cannot handle this alternative flow, the necessary access data gathering fails, and with that, any quotes data retrieval requests. I live outside of the EU, and therefore never got confronted with this situation (so far). Let me think about how this consent flow can be handled by the desklet. Off-topic: Fantastic World Athletics Championships your country is currently hosting!
Heny67
Heny67-1 year ago
Hi Thomas! I would like to note that I am not a programmer, I just hope my experience will help in the development. There are two things that could be related to the problem. 1. I can retrieve the data from the yahoo finance page without any problems. Sometimes it happens that I have to refresh the page several times because there are no results, but this is not common. 2. I use a personal financial software (money manager ex) where it is not possible to update stock and currency exchange rates in the same way. Even to this day, they have not been able to solve this problem there either. Off: Thank you for the recognition from the Athletics competition! :-)
Thomas Egli
Thomas Egli-1 year ago
I just prepared a new PR that addresses the cookie consent situation. Hopefully this should make the desklet working again for everyone.
Gerald Drißner
Gerald Drißner-1 year ago
YES, it works now! Many thanks for you work!!
Heny67
Heny67-1 year ago
Hi Thomas! It works fine now, thank you!
Heny67
Heny67-1 year ago
Hi! No, it still doesn't work.
Heny67
Heny67-1 year ago
No changes.
Heny67
Heny67-1 year ago
Hi! I get "yahoo finance service is currently unavailable" message with both v6 and v7 api!
Thomas Egli
Thomas Egli-1 year ago
V7 is the one to use. The old V6 was shut down. The latest version (released yesterday) brought a feature for this (new) "service unavailable" problem: 1. Open the settings dialog (right-click on desklet, then select "Configure...") 2. Enable the new option "Send custom User-Agent header" (at the bottom on the first tab) 3. Leave the default value, and close the settings dialog. The setting applies immediately, and quotes data should appear again. Hope this helps.
wp-dave
wp-dave-1 year ago
FWIW, the above instructions worked for both my linux (Linux Mint 20.3) machines. One machine I had to give the old Ctrl-Alt-Esc for resetting Cinnamon just after the "Configure.." option in the instructions. My other machine, the polling for Yahoo Finance worked without manual intervention. The only difference, really, is that the first machine has a ton of apps on this installation so I don't know if, with a bit of patience, the polling would have worked without my intervention.
wp-dave
wp-dave-1 year ago
..what I meant to say was.. after the instructions, if the polling doesn't work, the reset Cinnamon. Just to clarify..
Heny67
Heny67-1 year ago
No changes.
Thomas Egli
Thomas Egli-1 year ago
I just checked, and it (still) works on my end, even without the new setting.
Thomas Egli
Thomas Egli-1 year ago
Thank you for the screenshot to verify the configuration. It really looks like the new setting does not help to circumvent the reduced availability of the Yahoo Finance service in your case. That's too bad. Unfortunately I don't have any other option to offer, except to keep on trying. I observed that after some time, the service gets responsive again.
Goodolandy
Goodolandy-1 year ago
That just started today for me.
Thomas Egli
Thomas Egli-1 year ago
FYI: I prepared a new PR that should/will fix the recent issues with V7. Stay tuned...
wp-dave
wp-dave-1 year ago
The latest bugfix worked for me. Thanks, Thomas.
asp1
asp1-1 year ago
Hi Thomas, Thanks a lot for your nice desklet and its quick fix! Great job!
Gerald Drißner
Gerald Drißner-1 year ago
Great applet - however, since 7th of May 2023, there is a connection error to yahoo on my system. Does anyone else have this problem?
David
David-1 year ago
Sorry to report that the problem has returned - May 24 05:20 GMT
David
David-1 year ago
On a whim - using "sed" as I reset to V7 - it didn't work so I went back to V6 - still no luck.
Thomas Egli
Thomas Egli-1 year ago
You are correct, the V6 no longer works right now (returns a 404). As always, it is unclear whether this is a temporary outage, or the V6 endpoint got retired. Since the V7 endpoint now requires authentication, I cannot provide any quick fix this time.
David
David-1 year ago
The long term fix you did for authenticating the V7 endpoint was just now updated on my computer 30/6/23 - 11:25 (GMT+3). It works! THANKS THOMAS!
Thomas Egli
Thomas Egli-1 year ago
Something changed on the Yahoo API, and a 401 error is currently returned for each request. I don't know if and when it will be fixed - a similar problem occurred a few weeks ago. As a quick workaround, we can fallback to an older endpoint of the API. We just need to change the URL in the desklet: 1. Open a terminal. 2. Execute the following sed command: sed -i 's/v7/v6/g' ~/.local/share/cinnamon/desklets/yfquotes@thegli/desklet.js 3. Restart Cinnamon, e.g. with the shortcut Ctrl+Alt+Esc, or by log out and in again. Hope this helps.
Shimon Rura
Shimon Rura-1 year ago
Thanks, this worked for me too!
wp-dave
wp-dave-1 year ago
Thanks Thomas, that fix worked for me. Appreciate the fast response!
David
David-1 year ago
Thanks Thomas! I did as you suggested and it worked. I wonder if we may lose some functionality in the future by using the older Yahoo API. But that is for another day - for now, I'm happy, thanks to you!
Stephen Merrony
Stephen Merrony-1 year ago
Worked for me, thanks.
Gerald Drißner
Gerald Drißner-1 year ago
Hi, thank you for your quick reply and help! I tried it, but unfortunately, it didn't work. I did not get the exchange rates/prices. I only got the "symbols" replicated, e.g., EURUSD=X - but no result. I hope that yahoo won't shut down the access. Thanks for your work!
Thomas Egli
Thomas Egli-1 year ago
Too bad that it doesn't work for you, as this did the trick on my machine. But at least no more error message ;-) Maybe it helps if you reset the desklet (via context menu "Configure...", then menu entry "Reset to default"). Note that your current list will be replaced with this.
Gerald Drißner
Gerald Drißner-1 year ago
Now, it also works with your fix!!! Thanks a lot (don't ask me why it suddenly worked...)
sbadux
sbadux-3 years ago
Thank you very much for this applet. Super-useful and customizable. I love it.
michaeltjester
michaeltjester-3 years ago
Is it currently possible to add a memo to the line items? My goal is to input my cost for each of the stocks that I am tracking so that I can keep track of where I am at and whether I should sell easily.
Thomas Egli
Thomas Egli-3 years ago
Sorry but no, that is not possible. This desklet is not intended for portfolio management.
Goodolandy
Goodolandy-3 years ago
Hello, great desklet. I was wondering, is it possible to add an option to input number stocks owned next to each stock and the total value being displayed?
rijabo
rijabo-3 years ago
one of a kind and very useful and working. Would love to have the possebility to change border/no border and change the font color white to some other color. But like i said. Great desklet
Thomas Egli
Thomas Egli-3 years ago
Thank you for your interest. The styles are defined in a CSS file, found at ~/.local/share/cinnamon/desklets/yfquotes@thegli/stylesheet.css. Feel free to change them to your liking. You might want to make a backup of your modifications, as the file will get overwritten on the next desklet update.
Foxbille
Foxbille-4 years ago
Hello, Thanks for this very useful desklet, but is it possible make a small modification of the code to grab data from EuroNext ? (and get French quotations values) Eric
Thomas Egli
Thomas Egli-4 years ago
I have no plans to integrate other financial information provider; the desklet is called Yahoo Finance Quotes for a reason :-) Out of curiosity, for which French quotes are you looking for?
Foxbille
Foxbille-4 years ago
Thanks for your answer. I'm looking for ALBLU,ALCRB, CLA, EDEN, EPS, ALESK, GTT, IPH, ALMDG, DIM, BN, PUB, SCR, EO, KORI, SPIE, NEX, ELIOR, COFA, IPS, FNAC, ABIO, SII, NRG, POXEL, IGE and LFDE
Thomas Egli
Thomas Egli-4 years ago
I haven't tested all of them, but the ones I picked were all available. Just append .PA to your symbol, and you get ALBLU.PA, CLA.PA, NEX.PA etc. You can look them up on https://finance.yahoo.com to find out what Yahoo Finance Quotes uses. French stocks usually have a "PA" (for Paris) suffix. Try it out :-)
Foxbille
Foxbille-4 years ago
Works fine !!! Thanx a lot ;-)
plaihonen
plaihonen-4 years ago
Hi, quite useful desklet. I have some suggestions though. * Title on top of the desklet. This would be useful if more than one instance. The "updated" info could be moved from the bottom to the top with the title. * Option to add divider. This could be something like "---" in the quote symbols list. I have no clue how challenging this would be to program with the existing sorting functionality. * Option to align left. This would improve readability. At least with the longer "Verbose name" the impact would be significant.
Thomas Egli
Thomas Egli-4 years ago
I remember that I tried left alignment once. If the listed quote names have more or less the same length, then it looks better than centered, but if you have a mix of very short and very long names, then I felt that there is too much space to the next column. So I kept the center alignment, as I couldn't come up with something better, and in the meantime I got used to it. Regarding title and divider/spacer: I never thought about that but the sorting would definitely be a bit of a challenge.
jupiterjosh
jupiterjosh-4 years ago
Excellent desklet! May I make a suggestion that you include words like "stock" or "ticker" in your desklet description? You may find more people downloading the desklet if you add those words. I only found the spice by googling it, but since I was using the words "stock", "price", "ticker" etc, this desklet didn't come up in the desklet search bar.
Thomas Egli
Thomas Egli-4 years ago
Happy you like it. And thanks for your suggestion. I will improve the description in a future update.
newlinuxuser
newlinuxuser-4 years ago
Hi. how to add currency pairs?
Thomas Egli
Thomas Egli-4 years ago
Currency pair symbols follow the pattern "[Target Currency][Base Currency]=X", for instance "EURUSD=X". You can look them up on https://finance.yahoo.com/currencies.
Xcelerate11
Xcelerate11-4 years ago
This desklet is amazing! Does anyone know how I can create multiple instances of this desklet?
Thomas Egli
Thomas Egli-4 years ago
With the latest version, you can now create up to 10 instances.