• Fetching stock market data

    From Patric@3:633/10 to All on Thursday, January 22, 2026 19:19:18
    Hi all,

    after a longer hiatus from RISC OS I'm currently exploring a few options
    how to get more out of it in the modern world. Something that always
    fascinated me was exploring command line stuff like fetching a weather
    report from wttr.in.
    I simply created an obey file using wget to fetch, delete and overwrite
    weather reports as png for later viewing. Works great.

    There are similar sites like http://rate.sx for crypto currencies and terminal-stocks.dev designed for terminal access via cURL.
    Unfortunately they're next to unusable with RISC OS. Fetching works fine
    but Taskwindow or Nettle (running as ANSI task) interpret all the escape
    codes meant for unix xterm literally, resulting in garbage.

    Trying to force plain text output like this:

    *curl -H "Accept-Encoding: identity" "http://rate.sx/btc?plain=1" | tr
    -cd '\11\12\15\40-\176'

    also fails since cURL on RISC OS doesn't seem to pass any of that on.
    So that's a bit disappointing.
    The only thing I could get working was:

    *curl "https://stooq.com/q/l/?s=EUNL.DE&f=sd2t2ohlcv&h&e=csv" >
    MSCI_World.txt

    which gives:

    Symbol,Date,Time,Open,High,Low,Close,Volume EUNL.DE,2026-01-21,17:30:00,111.7,112.58,111,112.245,340009

    So better than nothing obviously but very very basic really.
    Is there a better way or should I just turn on the wireless at 12.30 for
    the business report?

    Patric


    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Patric@3:633/10 to All on Saturday, January 24, 2026 22:48:24
    In article <10kufr8$3frj3$1@druck.eternal-september.org>,
    druck <news@druck.org.uk> wrote:

    If you want to do anything with the data rather than just displaying,
    the Requests module in Python3 does the same thing as curl, but Python
    makes it much easier to extract the relevant data.

    I used to manually update a Fireworkz spreadsheet every month with the
    fund prices of my investment, but now I use a Python script to scrape
    the websited and output a csv which I can import in to Fireworkz and cut'n'paste the new row in.

    It works on with RISC OS's Python 3.8 albeit slowly using sequential lookups, it's faster on Linux where it fetches several pages in parallel.

    Thanks druck!

    Had a look at yfinance and as you guessed it's probably a bit more than
    what I'm looking for. I do use Portfolio Performance to keep track of
    things and sadly that's not something I can realistically hope to
    replicate with a regular spreadsheet, let alone on RISC OS.

    OTOH a csv file could be used for checking rather than tracking stocks as
    well. So maybe still worth investigating further.

    Patric


    --- PyGate Linux v1.5.5
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)