As you’ve heard on the podcast, I’ve been using ChatGPT to write scripts to automate a lot of my work. One of the scripts that I thought might help our club members is the one I use to automate sentiment checks. It has saved me a ton of time when I’m doing the checklist.

I recorded the below video that explains how it works and how you can modify it for your own purposes.

It will require some modifications to the script, which might be scary if you’re not a coder, but trust me, you can use GPT to help you. It will require a GPT subscription (so you get access to the latest model, GPT4-Turbo, currently $20 USD / month, and far better than the earlier models) but just cancel it after the first month if you don’t feel you have future use for it. That said, I’m using GPT all day, every day, so I think it’s a bargain.

Steps To Follow

  1. Watch the video.
  2. Download my script.
  3. Set up the two Google Sheets you’ll need. One is to store the stock codes you want to check, the other is the Brettalator.
  4. Make sure you create the necessary permissions on each sheet so the python script can access them. Ask GPT how to go about that.
  5. If you want to create the IFTTT notifications so you get updates on the status of the script, set up an IFTTT account and ask GPT how to modify the notification section of my script to work in your computing / mobile device environment.
  6. If you don’t already have python installed on your computer, ask GPT for help installing it. It’s free.
  7. Get GPT to walk you through the script modification process and then ask it for help to test it on your computer.
  8. If the script fails, and it probably will at first, just post the error message into GPT and ask it to help you debug. I had to go through that loop a few times before I got it to run successfully. Have patience. It’s worth it in the end.

If you have any problems, let me know. And also let me know if it works for you.

Here’s GPT’s list of steps that was created in the video. If this is all gobbledygook to you, just ask GPT to break down each step in to simpler language.

  1. Python Environment: Ensure you have Python installed on your computer. This script looks like it’s written in Python, so you’ll need the Python interpreter to run it.
  2. Install Required Libraries:
    • You’ll need to install the gspread, oauth2client, googleapiclient, and requests libraries if they’re not already installed. You can do this using pip, Python’s package manager, with the command: pip install gspread oauth2client google-api-python-client requests.
  3. Google Sheets API Access:
    • You’ll need to set up access to the Google Sheets API. This involves creating a project in the Google Developers Console, enabling the Sheets API for that project, and creating service account credentials.
    • Download the JSON key file for your service account and replace the path in the script (/Users/cameron/Library/CloudStorage/Dropbox-Personal/Scripts/motherlode-gmail-api-fcee55f8d825.json) with the path to your downloaded key file.
  4. IFTTT Webhook:
    • If you want to use the IFTTT notification feature, set up an IFTTT account and create a webhook applet. Get your webhook URL and replace the existing URL in the send_ifttt_notification function with your URL.
  5. Google Sheets URLs:
    • Replace the URLs in the client.open_by_url() calls with the URLs of the Google Sheets documents you want to interact with. Make sure your service account has edit access to these sheets.
  6. Update File Paths:
    • The script writes debug information to a file (/Users/cameron/Library/CloudStorage/Dropbox-Personal/Scripts/debug_output_ASX.txt). Change this file path to a location on your computer where you want to save the debug information.
  7. Review and Understand the Code:
    • Before running the script, make sure you understand what each part of the script does, especially the parts that write to or modify your Google Sheets. You might need to adjust indices or column/row numbers based on the structure of your sheets.
  8. Run the Script:
    • Once everything is set up, you can run the script. If you’re doing this from the command line, navigate to the directory containing the script and run python script_name.py, replacing script_name.py with the name of your Python script file.

Remember, it’s crucial to understand what the script does before running it, as it has the capability to modify data in your Google Sheets and send notifications via IFTTT.