Browse Source

Stuff

master
NCLanceman 5 months ago
parent
commit
2a6bfb4c0b
  1. 6
      iconSelector.py
  2. 6
      weather.py

6
iconSelector.py

@ -1,4 +1,8 @@
weatherWords = ["clear", "cloudy", "wind", "thunderstorm", "rain"]
adjectives = ["severe", "scattered", "partly", "mostly"]
clearWords = ["clear", "sunny"]
rainWords = ["rain", "showers"]
fogWords = ["fog", "mist", "smoke"]
windWords = ["wind", "windy", "gusts"]
def parseDescription(desc):

6
weather.py

@ -1,10 +1,6 @@
import requests
import math
import sys
from pathlib import PurePath, PurePosixPath
currentPath = PurePath('.')
try:
stationName = sys.argv[1]
@ -90,7 +86,7 @@ else:
temp = convertToF(request_json["properties"]["temperature"]["value"])
roundedTemp = rounding(temp)
condition = request_json["properties"]["textDescription"]
timeOfDay = request_json['properties']['icon'].split("/")[5]
# print(f"<txt> \u2601 {condition}, {roundedTemp} F</txt>")
print(
f"<img>/home/nclanceman/tools/weather/smallIcons/cloudy-small.png</img><txt> {condition}, {roundedTemp}F</txt>")

Loading…
Cancel
Save