import bellevue_reporter_rss_renderer import constants import cnn_rss_renderer import gdata_oauth import gcal_renderer import gkeep_renderer import health_renderer import local_photos_mirror_renderer import mynorthwest_rss_renderer import myq_renderer import pollen_renderer import reddit_renderer import renderer import seattletimes_rss_renderer import secrets import stevens_renderer import stranger_renderer import stock_renderer import twitter_renderer import weather_renderer import wsj_rss_renderer 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() seconds = 1 minutes = 60 hours = constants.seconds_per_hour always = seconds * 1 # 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)}), # pollen_renderer.pollen_count_renderer( # {"Poll" : (hours * 1)}), myq_renderer.garage_door_renderer( {"Poll MyQ" : (minutes * 5), "Update Page" : (minutes * 5)}), bellevue_reporter_rss_renderer.bellevue_reporter_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "www.bellevuereporter.com", [ "/feed/" ], "Bellevue Reporter" ), mynorthwest_rss_renderer.mynorthwest_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "mynorthwest.com", [ "/feed/" ], "MyNorthwest News" ), cnn_rss_renderer.cnn_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "rss.cnn.com", [ "/rss/money_latest.rss", "/rss/money_mostpopular.rss", "/rss/money_news_economy.rss", "/rss/money_news_companies.rss" ], "CNNMoney" ), cnn_rss_renderer.cnn_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "rss.cnn.com", [ "/rss/cnn_tech.rss", "/rss/money_technology.rss" ], "CNNTechnology" ), cnn_rss_renderer.cnn_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "rss.cnn.com", [ "/rss/cnn_topstories.rss", "/rss/cnn_world.rss", "/rss/cnn_us.rss" ], "CNNNews" ), wsj_rss_renderer.wsj_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "feeds.a.dj.com", [ "/rss/RSSWorldNews.xml" ], "WSJNews" ), wsj_rss_renderer.wsj_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "feeds.a.dj.com", [ "/rss/RSSMarketsMain.xml", "/rss/WSJcomUSBusiness.xml"], "WSJBusiness" ), health_renderer.periodic_health_renderer( {"Update Perioidic Job Health" : (seconds * 45)}), stock_renderer.stock_quote_renderer( {"Update Prices" : (hours * 1)}, [ "MSFT", "SPY", "GBTC", "IEMG", "OPTAX", "SPAB", "SPHD", "SGOL", "VDC", "VYMI", "VNQ", "VNQI" ]), stevens_renderer.stevens_pass_conditions_renderer( {"Fetch Pass Conditions" : (hours * 1)}, "www.wsdot.com", [ "/traffic/rssfeeds/stevens/Default.aspx" ]), seattletimes_rss_renderer.seattletimes_rss_renderer( {"Fetch News" : (hours * 1), "Shuffle News" : (always)}, "www.seattletimes.com", [ "/pacific-nw-magazine/feed/", "/life/feed/", "/outdoors/feed/" ], "Seattle Times Segments"), weather_renderer.weather_renderer( {"Fetch Weather (Bellevue)": (hours * 4)}, "home"), weather_renderer.weather_renderer( {"Fetch Weather (Stevens)": (hours * 4)}, "stevens"), weather_renderer.weather_renderer( {"Fetch Weather (Telma)" : (hours * 4)}, "telma"), local_photos_mirror_renderer.local_photos_mirror_renderer( {"Index Photos": (hours * 24), "Choose Photo": (always)}), gkeep_renderer.gkeep_renderer( {"Update": (minutes * 10)}), gcal_renderer.gcal_renderer( {"Render Upcoming Events": (hours * 2), "Look For Triggered Events": (always)}, oauth), reddit_renderer.showerthoughts_reddit_renderer( {"Scrape": (hours * 6), "Shuffle": (always)} ), reddit_renderer.til_reddit_renderer( {"Scrape": (hours * 6), "Shuffle": (always)} ), reddit_renderer.seattle_reddit_renderer( {"Scrape": (hours * 6), "Shuffle": (always)}), reddit_renderer.quotes_reddit_renderer( {"Scrape": (hours * 6), "Shuffle": (always)}), reddit_renderer.lifeprotips_reddit_renderer( {"Scrape": (hours * 6), "Shuffle": (always)}), twitter_renderer.twitter_renderer( {"Fetch Tweets": (minutes * 15), "Shuffle Tweets": (always)}) ] def get_renderers(): return __registry