Good stock ticker program?

Hi all!
Brand new to this, and I started with the headline project. I got it working and am now hoping to try a stock ticker project. Anyone have any good stock ticker projects that have been recently updated and are based on the rpi-rgb-lex-matrix?

Thank you all so much!

you’ll probably find some with google searches, something in python and then pipe the output to the library?

YOu can use this below.

import json
from yahooquery import Ticker

aapl = Ticker('GME')

stock1 = json.dumps(aapl.price)
stock = json.loads(stock1)
#print(stock)


print( stock["GME"]["regularMarketPrice"])

OR

from samplebase import SampleBase
from rgbmatrix import graphics
import time
import requests
from bs4 import BeautifulSoup as bs


class RunText(SampleBase):

    def run(self):
      while True:
        res = requests.get('https://www.marketwatch.com/investing/stock/gme')
        soup = bs(res.content, 'lxml')
        price = soup.select_one('.intraday__price .value').text

        res1 = requests.get('https://www.marketwatch.com/investing/stock/etsy')
        soup1 = bs(res1.content, 'lxml')
        price1 = soup1.select_one('.intraday__price .value').text

        res2 = requests.get('https://www.marketwatch.com/investing/stock/aapl')
        soup2 = bs(res2.content, 'lxml')
        price2 = soup2.select_one('.intraday__price .value').text

        offscreen_canvas = self.matrix.CreateFrameCanvas()
        font = graphics.Font()
        font.LoadFont("../../../fonts/6x10.bdf")
        textColor = graphics.Color(255, 255, 0)
        stock2 = graphics.Color(139, 0, 0)
        stock3 = graphics.Color(64, 0, 255)
        pos = offscreen_canvas.width
        my_text =  " GME: " + price
        my_text1 = "ETSY: " + price1
        my_text2 = "AAPL: " + price2

        while True:
            offscreen_canvas.Clear()
            len = graphics.DrawText(offscreen_canvas, font, pos, 10, textColor, my_text)
            len2 = graphics.DrawText(offscreen_canvas, font, pos, 18, stock2, my_text1)
            len3 = graphics.DrawText(offscreen_canvas, font, pos, 26, stock3, my_text2)
            pos -= 1
            if (pos + len3 < 0):
                pos = offscreen_canvas.width
                break
            time.sleep(0.08)
            offscreen_canvas = self.matrix.SwapOnVSync(offscreen_canvas)

#Main function
if __name__ == "__main__":
    run_text = RunText()
    time.sleep(0.08)
    if (not run_text.process()):
        run_text.print_help()

I am having trouble getting that second script to work. I keep returning an error that says "bs4.FeatureNotFound: Couldn’t find a tree builder with the features you requested: lxml. Do you need to install a parser library?

I have installed everything I need and have double checked that it is installed.

Any suggestions?

Could not get the 1st one with YahooQuote working.
Eventually got the 2nd one working with BeautifulSoup4.
Have to run it from the bindings/python/samples directory or the import SampleBase (samplebase.py) won’t work.
apt-get install python3-dev
apt-get install pip3
apt-get install libxml2-dev libxslt1-dev
anything else it needs…

I named it ticker.py

then (for my 32 by 64 column matrix at 50% brightness)
sudo python3 ./ticker.py --led-no-hardware-pulse LED_NO_HARDWARE_PULSE --led-cols 64 -b 50