Gettin real tired of your shit weather API...

This commit is contained in:
JP
2020-06-16 18:41:40 +02:00
parent 8746cde608
commit 892ca5a843
+8 -1
View File
@@ -587,10 +587,17 @@ class Shitpost(commands.Cog):
#add up to 4.0 points for sun:
grade += float(weatherObj["d0zon"]) / 25
#add up to 5.0 points for temperature:
grade += min(5.0, float(weatherObj["d0tmax"])*float(weatherObj["d0tmax"])/130)
grade += min(5.0, float(weatherObj["gtemp"])*float(weatherObj["d0tmax"])/100)
#remove up to 5.0 points for rain/snow:
grade -= float(weatherObj["d0neerslag"]) / 20
#but since d0neerslag is very unreliable:
if float(weatherObj["d0neerslag"]) < 10:
if weatherObj["image"] in ["regen", "buien", "bliksem", "hagel", "sneeuw", "halfbewolkt_regen"]:
grade -= 2.0
elif "regen" in weatherObj["verw"] or "buien" in weatherObj["verw"]:
grade -= 1.5
#remove points for very hot weather: (above 30)
grade -= max(0, (float(weatherObj["d0tmax"]) - 30.0)/3 )
except: