Skip to content

Latest commit

 

History

History
76 lines (51 loc) · 2.81 KB

README.rst

File metadata and controls

76 lines (51 loc) · 2.81 KB

Online_Calendar

SUMMARY:Use VBA to extract my Free/Busy calendar from MS Outlook, and use Python & jinja2 to post it at https://DavidTutor.Neocities.org.
REPOSITORY:https://github.com/DavidJLambert/Online_Calendar/
Author: David J. Lambert
Version: 0.5.0
Date: August 4, 2024

Problem Description

I keep my calendar in the desktop version of Microsoft Outlook (the Classic Version, not the New Version). As a professional tutor who works online, I want to be able to post my Free/Busy schedule online, in my own format, so that my clients can see my schedule and request a time slot without my having to manually send my calendar to each person, and without having to manually re-send my calendar to each client every time the schedule changes.

Furthermore, I want to post my schedule converted into each major time zone on this planet (I've tutored students in Europe, the Far East, Australia, and the Middle East), so they can conveniently see my Free/Busy schedule in their own time zone.

This GitHub repository shows the code I have written to do this. You can see the resulting calendar at https://davidtutor.neocities.org.

Note that my online schedule is read-only. There exist websites that allow people to book appointments online, such as Calendly, but they rarely synchronize with desktop Outlook, and I have never seen one that allows clients to self-select when their appointment starts and ends. In principle, I could do this, but I have decided it is not worth the effort.

How It All Works

  1. In Microsoft Outlook, execute the VBA subroutine WriteSchedule (included in this project's WriteSchedule.bas).

    1. This VBA goes through the next 10 days of my Outlook Calendar.

    2. Finds all calendar items with BusyStatus="Busy".

    3. Saves the start and end times of all busy time slots to templates/schedule.tsv.

      Note: the VBA assumes there are never overlapping "Busy" calendar items.

  2. Execute generate_online_calendar.py, which

    1. Reads a list of the planet's timezones from function get_timezones (in timezones.py).

    2. Writes the list of time zones to web/index.html using jinja2 and templates/index_template.html.

    3. Reads my schedule from templates/schedule.tsv.

    4. Consolidates all adjacent busy time slots.

    5. Finds all free time slots.

    6. Translates all free time slots into each timezone obtained in Step 2b.

    7. Writes each time zone's translated schedule to web/UTC<NNN>.html using jinja2 and templates/tz_template.html, where <NNN> is the UTC offset for that time zone.

      Also included in the web directory is styles.css.

  3. Uses the neocitizen API to upload all the files in the web folder to https://davidtutor.neocities.org.