From cc2bf7cf94c3f4c6971e2ec8519d736131bc1558 Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Sat, 25 Nov 2023 10:48:03 -0600 Subject: [PATCH] calender cache --- wwfunc/packages/wildweb/calcache/__main__.py | 14 ++++++++++++++ wwfunc/packages/wildweb/calcache/build.sh | 7 +++++++ wwfunc/packages/wildweb/calcache/requirements.txt | 1 + 3 files changed, 22 insertions(+) create mode 100644 wwfunc/packages/wildweb/calcache/__main__.py create mode 100755 wwfunc/packages/wildweb/calcache/build.sh create mode 100644 wwfunc/packages/wildweb/calcache/requirements.txt diff --git a/wwfunc/packages/wildweb/calcache/__main__.py b/wwfunc/packages/wildweb/calcache/__main__.py new file mode 100644 index 0000000..20ae948 --- /dev/null +++ b/wwfunc/packages/wildweb/calcache/__main__.py @@ -0,0 +1,14 @@ +import requests + +from filecache import filecache + +@filecache(10 * 60) +def main(): + resp = requests.get("https://calendar.google.com/calendar/ical/62da059a43acfa2924e50e6aaa43e3aed3728f7eda51af7d7a43f0313404e09c%40group.calendar.google.com/public/basic.ics") + return { + "headers": { + "Content-Type": "text/calendar" + }, + "statusCode": 200, + "body": resp.text + } diff --git a/wwfunc/packages/wildweb/calcache/build.sh b/wwfunc/packages/wildweb/calcache/build.sh new file mode 100755 index 0000000..6c9828b --- /dev/null +++ b/wwfunc/packages/wildweb/calcache/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +virtualenv --without-pip virtualenv + +pip install -r requirements.txt --target virtualenv/lib/python3.11/site-packages diff --git a/wwfunc/packages/wildweb/calcache/requirements.txt b/wwfunc/packages/wildweb/calcache/requirements.txt new file mode 100644 index 0000000..cc80985 --- /dev/null +++ b/wwfunc/packages/wildweb/calcache/requirements.txt @@ -0,0 +1 @@ +filecache==0.81