Live Bank Balance & Trading Portfolio

Description of what you are sharing
Live Bank Balance & Trading Portfolio TouchBar Widgets

Screenshots (optional)

Hi guys, I've just finished creating two widgets, one which shows my live bank balance, and one that shows my stock portfolio balance. I can share snippets of code if anyone would like to recreate it!

Bank Balance

  1. Connects to my bank using TrueLayer API
  2. Zapier connects to TrueLayer via webhook POST to firstly, refresh the auth token
  3. Zapier connects to TrueLayer via webhook GET to acquire the accounts balance
  4. Zapier uses Utilities to convert line-item to text. This extracts the balance from the API response
  5. Zapier uses the Google Drive zap to replace a txt file with a new one containing the balance
  6. Google drive syncs that file to my laptop automatically, replacing the previous one
  7. BTT uses applescript to return the balance from the txt file to the title

Thats it! The only code required for everything is step 7 (below). Zapier does the rest.

set theFile to (read POSIX file "Volumes/GoogleDrive/My Drive/BankConnect/Balance.txt")
set theFile to "£" & theFile
return theFile

Trading Portfolio Balance

  1. Uses a list of trades which live update on google sheets and adds the total to a specific cell
  2. Zapier extracts the cells value hourly
  3. Zapier uses the Google Drive zap to replace a txt file with a new one containing the balance
  4. Google drive syncs that file to my laptop automatically, replacing the previous one
  5. BTT uses applescript to return the balance from the txt file to the title

My specific trading app does not have an API as of yet so its not fully live as I have to update the trades manually, but that isn't too common for me so it will be fine until they release an API.

Thats it hope it gives someone an idea!

Imprint | Privacy Policy