Gettin real tired of your shit weather API...
This commit is contained in:
+8
-1
@@ -587,10 +587,17 @@ class Shitpost(commands.Cog):
|
|||||||
#add up to 4.0 points for sun:
|
#add up to 4.0 points for sun:
|
||||||
grade += float(weatherObj["d0zon"]) / 25
|
grade += float(weatherObj["d0zon"]) / 25
|
||||||
#add up to 5.0 points for temperature:
|
#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:
|
#remove up to 5.0 points for rain/snow:
|
||||||
grade -= float(weatherObj["d0neerslag"]) / 20
|
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)
|
#remove points for very hot weather: (above 30)
|
||||||
grade -= max(0, (float(weatherObj["d0tmax"]) - 30.0)/3 )
|
grade -= max(0, (float(weatherObj["d0tmax"]) - 30.0)/3 )
|
||||||
except:
|
except:
|
||||||
|
|||||||
Reference in New Issue
Block a user