Code Monkey home page Code Monkey logo

calendar-on-call's Introduction

calendar-on-call

Current live link (to see what it looks like:) calendar-on-call

TODO

  • Error handling!
    • bad Google Calendar URL
    • Case-insensitive contact list
    • location name with space/symbol
    • more...
  • change isResLife fallback number in location-specific interface
  • change fallback number based on weekend/weekday/specific day
  • change forwarded call message in GUI
  • change Google Calendar in GUI
  • change forwarding number in GUI
  • security!
    • don't allow showing python code
    • separate public_html stuff from backend code
    • only allow deploy.cgi to be called from the Github IP blocks (dev only)
  • allow seeing contents of calendar (or at least next person on duty).
  • more...

Design

Every time main.cgi is called, it reads in all information (locations, etc) from a JSON text file (calendar-on.call.dat. JSON is like YAML but doesn't require another dependency). If any changes are made (adding/removing a location, updating contact list, manual override), it saves all that information into the DAT file for the next time. update.cgi also reads in this DAT file to get the list of locations to call update() on.

  • Location.py: takes a dictionary of parameters, including the Twilio phone number ID, the icalendar URL, a location name, and a sub-dictionary containing the contact list for that location.
  • main.cgi: Currently displays all locations that have been added, allows for adding a new location, and manually triggering an update check (using update.cgi, below)
  • update.cgi: When called, triggers an update check on all locations in the calendar-on-call.dat file. Will update the Twilio forwarding number for that location if the person on duty has changed (based on the Google Calendar icalendar URL associated with that location).

update.cgi is currently called by cronjob every 3 minutes. The interval should probably be increased later.

Dependencies

  • pip install twilio
  • pip install python-dateutil
  • pip install icalendar

Misc

  • What should the web interface handle?
    • Manually specifying a number to forward to for a Location (overriding duty calendar). -@smitau01 I think a manual override is a great idea but it needs to have a shutoff value set and a defult shutoff override.
    • Show current information - Locations, forwarding numbers, calendars, etc. -@smitau01 I'd say if there can be an "admin" dashboard of sorts that anyone with the top level admin login can see all the numbers in use and who they are set up to forward to at the present time. Also if we can do some basic authentication stuff (maybe later once this is covered in class? otherwise I know a basic form of it would be pretty easy to implement so that each AHD or "location manager" can only edit or manually override for their location.

My attempt at a google Contacts API key request:

Client ID: 709696327552.apps.googleusercontent.com Email address: [email protected] Client secret: fxZAnABYEpMr4V_lGSaw-fqF Redirect URIs: https://knuth.luther.edu/~smitau01/* https://knuth.luther.edu/~dontis01/* JavaScript origins: none

calendar-on-call's People

Contributors

audiosmitty avatar isaacdontjelindell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.