Merge pull request #5 from Mason10198/develop

Remove leftover debug line
pull/17/head
Mason10198 3 years ago committed by GitHub
commit 1779660964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -292,8 +292,7 @@ def getAlerts(countyCodes):
logger.debug("Checking for alerts in {}".format(countyCodes)) logger.debug("Checking for alerts in {}".format(countyCodes))
for countyCode in countyCodes: for countyCode in countyCodes:
logger.debug("Checking for alerts in {}".format(countyCode)) logger.debug("Checking for alerts in {}".format(countyCode))
# url = "https://api.weather.gov/alerts/active?zone={}".format(countyCode) url = "https://api.weather.gov/alerts/active?zone={}".format(countyCode)
url = "https://api.weather.gov/alerts/active?area=AR" # THIS RETURNS ALL ACTIVE ALERTS IN THE US
logger.debug("Requesting {}".format(url)) logger.debug("Requesting {}".format(url))
response = requests.get(url) response = requests.get(url)
logger.debug("Response: {}\n\n".format(response.text)) logger.debug("Response: {}\n\n".format(response.text))
@ -332,8 +331,8 @@ def getAlerts(countyCodes):
) )
) )
# Convert list to set to eliminate duplicates, then convert back to list # Eliminate duplicates in a way that preserves order
alerts = list(set(alerts)) alerts = [x for i, x in enumerate(alerts) if alerts.index(x) == i]
# Sort by both API-provided severity and 'words' severity # Sort by both API-provided severity and 'words' severity
alerts.sort( alerts.sort(

Loading…
Cancel
Save

Powered by TurnKey Linux.