Geek Script

Joined
May 7, 2011
Messages
2
Reaction score
0
Points
1
Hello one and All, I hope I am posting this in the correct area.
I have a geeklet Script for Weather to be displayed on my desk top, It works fine but shows the Temp in .F instead of .C any idea's please on how to solve this

curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX1718&u=c&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
 
Joined
May 14, 2009
Messages
2,052
Reaction score
136
Points
63
Location
Near Whitehorse, Yukon
Your Mac's Specs
2012 MBP i7 2.7 GHz 15" Matte - 16 GB RAM - 120 GB Intel SSD - 500 GB DataDoubler Mac OS 10.9
Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX1718&u=c" | grep -E '(Current Conditions:|C<BR)' | tail -n1 | sed -e 's/<BR \/>//' -e 's/ C$/˚C/'

Try that

EDIT: Hmm, it looks slightly different from yours so test it and see if it's ok for you.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX1718&u=c&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'
The red part is the issue (as picked up on by McYukon). Your asking for the weather from the Yahoo Weather API service in metric and then asking for it in imperial. Since imperial measurements are requested last, those are the ones you get. Just in case you wanted to know.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top