For those who like to live in command line and python script to tell you what the weather is like (although if you live on the CL you probably don’t go outside much so it’s pretty irrelevant).
The weather forecast is from Yahoo weather, after entering your locale get the code from the url, for example http://weather.yahoo.com/forecast/UKXX0123.html is Glasgow. The part we are interested in is the code “UKXX0123″.
Save the script as “weather”, make it executable and put in executable directory like /usr/local/bin
Now open a new terminal window and you should get this:
test@testing:~$ weather Current Conditions: Partly Cloudy, 13 C Forecast: Mon - Partly Cloudy. High: 14 Low: 7 Tue - Partly Cloudy. High: 16 Low: 8
Now the code.
#!/usr/bin/env python
import feedparser,re
feed="http://weather.yahooapis.com/forecastrss?p=YOUR-CODE-HERE&u=c"
data=feedparser.parse(feed)
pattern='<.+?>'
summary=data.entries[0].summary
forecast=re.sub(pattern,'',summary)
forecast=re.split('\n',forecast)
for line in forecast[0:-2]:
print line
Buy:Viagra.Propecia.Super Active ED Pack.Levitra.Viagra Super Force.Soma.Viagra Soft Tabs.Maxaman.Cialis Super Active+.Cialis.Cialis Soft Tabs.Viagra Super Active+.Cialis Professional.Tramadol.VPXL.Viagra Professional.Zithromax….
Buy:Retin-A.Accutane.Prevacid.Prednisolone.Zyban.Petcam (Metacam) Oral Suspension.Arimidex.100% Pure Okinawan Coral Calcium.Human Growth Hormone.Actos.Valtrex.Mega Hoodia.Zovirax.Nexium.Lumigan.Synthroid….