From 0fbf9ed9e48d0f0f7f646f78635a40023048bc97 Mon Sep 17 00:00:00 2001 From: Alexander Munch-Hansen Date: Sat, 6 Apr 2019 16:45:10 +0200 Subject: [PATCH] Added documentation --- server/nightr/strategies/cars_in_traffic.py | 5 ++++- server/nightr/strategies/upstairs_neighbour.py | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/nightr/strategies/cars_in_traffic.py b/server/nightr/strategies/cars_in_traffic.py index 65cf324..8cb4ea8 100644 --- a/server/nightr/strategies/cars_in_traffic.py +++ b/server/nightr/strategies/cars_in_traffic.py @@ -3,7 +3,10 @@ import requests from ..util import Prediction, Context -def scrape_traffic(context: Context) -> Prediction: +def cars_in_traffic(context: Context) -> Prediction: + """ + How many cars are currently driving around Aarhus? + """ r = requests.get('https://portal.opendata.dk/api/3/action/datastore_search?resource_id=b3eeb0ff-c8a8-4824-99d6-e0a3747c8b0d') night_avr = 3.38 day_avr = 6.98 diff --git a/server/nightr/strategies/upstairs_neighbour.py b/server/nightr/strategies/upstairs_neighbour.py index 51ba11c..b340c58 100644 --- a/server/nightr/strategies/upstairs_neighbour.py +++ b/server/nightr/strategies/upstairs_neighbour.py @@ -10,6 +10,9 @@ def update(): def check_games(context: Context) -> Prediction: + """ + Is Alexanders upstairs neighbour currently playing League of Legends? + """ update() r = requests.get('https://euw.op.gg/summoner/userName=Im+Eating+Pros')