Typhoon,
Here it is, THE multiple warnings script!! =P
I was only able to test with 3 hazards and it worked so normally it will do fine with 6 or more.
i've set your location weather link, and yeah not very interesting only sun sun sun sun and moon
Can you post a screenshot from your geektool setup?
Here it is, THE multiple warnings script!! =P
I was only able to test with 3 hazards and it worked so normally it will do fine with 6 or more.
i've set your location weather link, and yeah not very interesting only sun sun sun sun and moon
Can you post a screenshot from your geektool setup?
Code:
tell application "Finder"
set AppleScript's text item delimiters to ""
set warn to do shell script "curl \"http://forecast.weather.gov/MapClick.php?CityName=Washburn&state=WI&site=DLH&textField1=46.6739&textField2=-90.8933&e=0\""
-- count every warning!!
set AppleScript's text item delimiters to "<"
set warn_string to every text item of (warn as string)
set amo_warn to 1
repeat with i in items of warn_string
if (i as string) contains "span class=\"warn\">" then
set amo_warn to amo_warn + 1
end if
end repeat
-- getting the warnings
set warnings to ""
set warn_number to 1
repeat until warn_number = (amo_warn)
set warn_number to warn_number + 1
try
set AppleScript's text item delimiters to "<span class=\"warn\">"
set temp_warnings to text item warn_number of (warn as string)
set AppleScript's text item delimiters to "</span>"
set temp_warnings to text item 1 of temp_warnings
set AppleScript's text item delimiters to ""
set warnings to warnings & temp_warnings & return
end try
end repeat
if warnings = "" then
set warnings to "No upcoming weather hazards"
end if
return warnings
end tell