X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=renderer_catalog.py;h=1f38b4f677251b0a2219b57c2482b24a1a39ff6e;hb=addd4980077f6e3857c5c035b49784dc3ceca49a;hp=fcc1a2048b67eb349f1886761b93a883386d824e;hpb=c06bfef53f70551e7920bc4facce27f47b89e2ba;p=kiosk.git diff --git a/renderer_catalog.py b/renderer_catalog.py index fcc1a20..1f38b4f 100644 --- a/renderer_catalog.py +++ b/renderer_catalog.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 +import bellevue_city_calendar_renderer import bellevue_reporter_rss_renderer -import constants +import kiosk_constants import cnn_rss_renderer import gdata_oauth import gcal_renderer @@ -12,52 +13,57 @@ import local_photos_mirror_renderer import mynorthwest_rss_renderer import myq_renderer import reddit_renderer -import renderer import seattletimes_rss_renderer -import secrets import stevens_renderer -import stranger_renderer +import kiosk_secrets as secrets +import recipe_renderer_and_trigger import stock_renderer import twitter_renderer +import urbanist_renderer import weather_renderer import wsj_rss_renderer seconds = 1 minutes = 60 -hours = constants.seconds_per_hour +hours = kiosk_constants.seconds_per_hour always = seconds * 1 -oauth = gdata_oauth.OAuth(secrets.google_client_id, secrets.google_client_secret) -if not oauth.has_token(): - user_code = oauth.get_user_code() - print("------------------------------------------------------------") - print( - ( - 'Go to %s and enter the code "%s" (no quotes, case-sensitive)' - % (oauth.verification_url, user_code) - ) - ) - oauth.get_new_token() +oauth = gdata_oauth.OAuth(secrets.google_client_secret) # Note, the 1s updates don't really update every second; there's a max # frequency in the renderer thread of ~once a minute. It just means that # everytime it check these will be stale and happen. __registry = [ - stranger_renderer.stranger_events_renderer( - {"Fetch Events": (hours * 12), "Shuffle Events": (always)} - ), + # stranger_renderer.stranger_events_renderer( + # {"Fetch Events": (hours * 12), "Shuffle Events": (always)} + # ), myq_renderer.garage_door_renderer( {"Poll MyQ": (minutes * 5), "Update Page": (always)} ), + bellevue_city_calendar_renderer.bellevue_city_calendar_renderer( + { + "Fetch News": (hours * 1), + "Shuffle News": (always), + }, + "bellevuewa.gov", + ["/calendar/events.xml"], + "Bellevue City Calendar", + ), bellevue_reporter_rss_renderer.bellevue_reporter_rss_renderer( {"Fetch News": (hours * 1), "Shuffle News": (always)}, "www.bellevuereporter.com", ["/feed/"], "Bellevue Reporter", ), + urbanist_renderer.urbanist_renderer( + {"Fetch News": (hours * 2), "Shuffle News": (always)}, + "www.theurbanist.org", + ["/feed/"], + "The Urbanist", + ), mynorthwest_rss_renderer.mynorthwest_rss_renderer( {"Fetch News": (hours * 1), "Shuffle News": (always)}, "mynorthwest.com", @@ -88,6 +94,7 @@ __registry = [ ["/rss/RSSMarketsMain.xml", "/rss/WSJcomUSBusiness.xml"], "WSJBusiness", ), + stevens_renderer.stevens_renderer({"Unused": (minutes * 30)}), google_news_rss_renderer.google_news_rss_renderer( {"Fetch News": (minutes * 30), "Shuffle News": (always)}, "news.google.com", @@ -102,22 +109,21 @@ __registry = [ [ "MSFT", "SPY", - "GBTC", + "BTC-USD", "IEMG", - "OPTAX", + "ABHYX", "SPAB", "SPHD", - "SGOL", - "VDC", + "SCHD", + "BCD", + "GC=F", + "VYM", "VYMI", + "VDC", "VNQ", "VNQI", ], - ), - stevens_renderer.stevens_pass_conditions_renderer( - {"Fetch Pass Conditions": (hours * 1)}, - "www.wsdot.com", - ["/traffic/rssfeeds/stevens/Default.aspx"], + {"BTC-USD": "BTC", "GC=F": "GOLD"}, ), seattletimes_rss_renderer.seattletimes_rss_renderer( {"Fetch News": (hours * 4), "Shuffle News": (always)}, @@ -126,12 +132,12 @@ __registry = [ "Seattle Times Segments", ), weather_renderer.weather_renderer( - {"Fetch Weather (Bellevue)": (hours * 4)}, "home" + {"Fetch Weather (Bellevue)": (hours * 3)}, "home" ), weather_renderer.weather_renderer( - {"Fetch Weather (Stevens)": (hours * 4)}, "stevens" + {"Fetch Weather (Stevens)": (hours * 3)}, "stevens" ), - weather_renderer.weather_renderer({"Fetch Weather (Telma)": (hours * 4)}, "telma"), + weather_renderer.weather_renderer({"Fetch Weather (Telma)": (hours * 3)}, "telma"), local_photos_mirror_renderer.local_photos_mirror_renderer( {"Index Photos": (hours * 24), "Choose Photo": (always)} ), @@ -156,6 +162,9 @@ __registry = [ twitter_renderer.twitter_renderer( {"Fetch Tweets": (minutes * 15), "Shuffle Tweets": (always)} ), + recipe_renderer_and_trigger.RecipeRenderer( + "/home/pi/.recipe_url", {"Maybe Render Recipe Page": (always)} + ), ]