How abelweldaregay/banner-gcal-schedule-importer works
Project Type and Purpose
• This is a Chrome extension designed to automate the process of importing a semester’s course schedule from Banner (the web-based course management system) into Google Calendar or as an ICS file for other calendars.
• The extension extracts schedule data from the Banner schedule details page and uses it to build a new Google Calendar filled with course events. Multiple functionalities are supported: direct Google Calendar import and ICS file export for services like Microsoft Outlook.
Analyzing the File Structure
• JavaScript files (background.js, extract_schedule.js, gCalFunctions.js, googleAnalytics.js, googleApiClient.js, popup.js, and ics.js) handling the logic.
• popup.html and style.css providing the UI for user interactions (i.e., the popup when the extension is clicked).
• Other top-level files (README.md, _config.yml, demo video, help.md, privacy.md) are documentation and configuration files, indicating that the extension is well-documented and integrated with a website for help and privacy details.
Main Components
a. Extension User Interface
• Represented by popup.html, popup.js, and style.css.
b. Background Scripts and Core Logic
• background.js acts as the persistent background script managing state and initiating various processes.
• extract_schedule.js is the module that extracts schedule data once the user navigates to the Banner schedule details page.
c. Google Calendar and Third-Party Integration
• gCalFunctions.js and googleApiClient.js handle communication with the Google Calendar API to create, edit, or delete calendar events.
• Separate module (ics.js) handles exporting schedule data to an ICS file format, allowing integration with other calendar applications (e.g., MS Outlook).
• googleAnalytics.js is used to track user interactions and usage statistics.
d. Manifest and Configuration
• manifest.json defines the extension’s behavior, its permissions, and its file references. It is a central piece tying everything together.
Relationships and Interactions
• The UI (popup.html/popup.js) serves as the entry point when the user interacts with the extension.
• Upon user actions (e.g., clicking “import”), popup.js dispatches commands to background.js.
• background.js acts as the coordinator, triggering extract_schedule.js to retrieve the schedule data from the currently active Banner schedule details page.
• The extracted data is then passed to either:
• gCalFunctions.js (via googleApiClient.js) if the user chooses to create a Google Calendar.
• ics.js to generate an ICS file for download, thereby supporting different calendar systems.
• googleAnalytics.js simultaneously logs user activity, providing insights.
• All components are linked through manifest.json which ties each script and HTML file to the extension’s configuration.
Architectural Patterns and Design Principles
• Separation of Concerns: The project clearly delineates UI components from background logic and API integration modules.
• Modular Design: Each functionality (schedule extraction, Google Calendar API integration, ICS generation, analytics) is implemented in its own JavaScript file.
• Event-driven architecture: User actions trigger events that are handled by background and specific module scripts, maintaining a responsive and asynchronous flow.