I use Geektool
on the Mac to display various information on my desktop. One feature of Geektoool
is the ability to use shell mode to launch custom scripts or commands. I am not versed in any type of scripting, but find pieces on the web to use by copying and pasting. There are whole website dedicated to just this.
I have for a long time used a command to pull a one day weather forecast from Weather Underground. However they have changed their site and the output of the script needs to be edited. I am now getting duplicate information being displayed.
Example
Today is forecast to be Cooler than yesterday.
"weather_quickie": "Today is forecast to be Cooler than yesterday."
The script incorporates Textutil for the output.
curl -s http://www.wunderground.com/cgi-bin/findweather/getForecast?query=94965 |
awk '/Today is/ || /Tomorrow is/' | textutil -convert txt -stdin -stdout -format html
From the man page of textutil
, it seems like the option -excludedelements
can be used to edit out the extra info. However I can't understand the -excludedelements
explanation, nor figure out how to format it.
excludedelements (tag1, tag2, ...) - Specify which HTML elements should not be used in generated HTML (the list should be a single argument, and so will usually need to be quoted in a shell context).
I would like to edit out the "weather_quickie" part of the output. Any insight will be greatly appreciated.