michaelpanik / autojournal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

autojournal 📔

Not quite ready for prime time. To make this work, you'll need to add two files: a .env and a credentials.json, both in the project root.

.env should have the following vars:

  • OPENAI_API_KEY: OpenAI API key
  • DROPBOX_ACCESS_TOKEN: Dropbox Access Token (Dropbox is where recordings must be stored)
  • DROPBOX_AUDIO_FOLDER: Path to the folder in Dropbox where audio recordings are stored.

credentials.json should be a Google Cloud credentials file used to integrate with Google Drive.

Usage

  1. Create the creds mentioned above.
  2. You need an audio recorder app that automatically saves to dropbox. I use "Voice Recorder By LiveBird" on iOS
  3. npx ts-node daily.ts for the daily wrap-up
  4. npx ts-node weekly.ts for the weekly wrap-up

Logic Flow

Daily

  1. Collect all audio files in the dropbox folder.
  2. If no audio files, EXIT.
  3. If no folder for the year ([YYYY]) exists in Google Drive folder journals, create one.
  4. Get the current week of the year.
  5. If no folder for the week number (week_[WW]) exists in Google Drive folder for current year, create one.
  6. Use FFMPEG to combine into one audio file.
  7. Upload new audio file to Drive, in week_[WW]/audio with name [MM-DD-YYYY].mp3.
  8. Delete all files in dropbox folder.
  9. Send audio file to Whisper to convert to text.
  10. Store text as Google Doc, named [MM-DD-YYYY]-transcript, in current week's folder.
  11. Send output text to ChatGPT to summarize.
  12. Store summary as Google Doc, named [MM-DD-YYYY]-summary, in current week's folder.
  13. EXIT

Weekly

  1. Get the current week of the year.
  2. Collect all summary files in the weeks folder in Google Drive.
  3. If no summary files, EXIT.
  4. Combine all summary text to one input and send to ChatGPT to summarize.
  5. Store returned summary in the weeks folder, named week_[WW]_summary
  6. Send summary email
  7. EXIT

Monthly (?)

  1. Get the previous month
  2. Collect all subfolders (week folders) in the folder for that month.
  3. If no subfolders, EXIT.
  4. In each week folder, find the week summary file
  5. Combine all week summary files into one text.
  6. Send combined text to ChatGPT for summary.
  7. Send email including monthly summary and all weekly summaries
  8. EXIT

About


Languages

Language:TypeScript 100.0%