weatherget + Simply get wather

Fedora 9 + weatherget (or + conky )
Gentoo + conky weather report

Get on weatherget website and Download it, Current version is 0.4.0.1

after extracting the file, u need to run this command:

sudo yum install python-devel

and get into that extracted folder ((please check README file 1st):

example:

cd /tmp/weatherget-0.4.0.1

install
python setup.py install –root=/your path/to/root/

for myself, i did:
python setup.py install –root=/opt/weather/

sudo python setup.py install –root=/opt/weatherget/
running install
running build
running build_py
running build_scripts
running install_lib
creating /opt/weatherget
creating /opt/weatherget/usr
creating /opt/weatherget/usr/lib
creating /opt/weatherget/usr/lib/python2.5
creating /opt/weatherget/usr/lib/python2.5/site-packages
creating /opt/weatherget/usr/lib/python2.5/site-packages/Weatherget
copying build/lib/Weatherget/__init__.py -> /opt/weatherget/usr/lib/python2.5/site-packages/Weatherget
byte-compiling /opt/weatherget/usr/lib/python2.5/site-packages/Weatherget/__init__.py to __init__.pyc
running install_scripts
creating /opt/weatherget/usr/bin
copying build/scripts-2.5/weatherget -> /opt/weatherget/usr/bin
changing mode of /opt/weatherget/usr/bin/weatherget to 775
running install_data
creating /opt/weatherget/usr/share
creating /opt/weatherget/usr/share/man
creating /opt/weatherget/usr/share/man/man1
copying weatherget.1 -> /opt/weatherget/usr/share/man/man1
creating /opt/weatherget/usr/share/doc
creating /opt/weatherget/usr/share/doc/weatherget-0.4.0.1
copying COPYING -> /opt/weatherget/usr/share/doc/weatherget-0.4.0.1
copying README -> /opt/weatherget/usr/share/doc/weatherget-0.4.0.1
copying AUTHORS -> /opt/weatherget/usr/share/doc/weatherget-0.4.0.1
copying CHANGELOG -> /opt/weatherget/usr/share/doc/weatherget-0.4.0.1
running install_egg_info
Writing /opt/weatherget/usr/lib/python2.5/site-packages/weatherget-0.4.0.1-py2.5.egg-info

Now, u can use weatherget to check your local weather

seach city ID:
/opt/weatherget/usr/bin/weatherget -l london

East London, South Africa: SFXX0012
London, AR: USAR0340
London, United Kingdom: UKXX0085
London, KY: USKY1090
London, OH: USOH0520
London, Canada: CAXX0255
London, TX: USTX0788
London, WV: USWV0443
London Mills, IL: USIL0686
New London, CT: USCT0136

/opt/weatherget/usr/bin/weatherget –station-id=CAXX0255 –standard –extended-day=3

London, Canada (-81.25, 42.99)
London, Canada 5/25/08 5:00 AM Local Time
Temperature : 41 F
Feels Like : 41 F
Conditions : Partly Cloudy
Wind : 0 mph, 0 mph gusts, CALM
Visibility : Unlimited mi
Humidity : 93 %
Barometer : 30.16 in, rising
Dewpoint : 39 F
UV : Low, 0
Sunrise : 5:53 AM
Sunset : 8:52 PM
Moon : Waning Gibbous
Time Zone : -4 GMT

Tonight
High : 70 F
Low : 55 F
Conditions : Partly Cloudy
Precipitation : 20 %
Wind : 11 mph, 0 mph gusts, CALM
Humidity : 63 %
Sunrise : 5:53 AM
Sunset : 8:52 PM

Monday
High : 74 F
Low : 50 F
Conditions : Scattered T-Storms
Precipitation : 50 %
Wind : 15 mph, 0 mph gusts, CALM
Humidity : 74 %
Sunrise : 5:52 AM
Sunset : 8:53 PM

Tuesday
High : 57 F
Low : 41 F
Conditions : Few Showers
Precipitation : 30 %
Wind : 12 mph, 0 mph gusts, CALM
Humidity : 65 %
Sunrise : 5:51 AM
Sunset : 8:54 PM

—————————-

if needs this in conky, just add this line to your .conkyrc

{execi 1800 /opt/weatherget/usr/bin/weatherget -f ~/.scripts/weatherrc(your customized folder) –station-id=CAXX0255 –metric }

and create a file in ~/.script/weatherrc
add these info in it:

def current():
print temp + temp_units+’ ‘+cloud_type

DONE

—————–

More info about print format for weatherrc:

Temperature: ‘+temp+’ ‘+temp_units+’
Feels Like: ‘+feels_like+’ ‘+temp_units+’
Conditions: ‘+cloud_type+’
Wind: ‘+wind_speed+’ ‘+speed_units+’, ‘+wind_gust+’ ‘+speed_units+’ gusts, ‘+wind_dir+’
Visibility: ‘+visibility+’ ‘+dist_units+’
Humidity: ‘+humidity+’ %’+’
Barometer: ‘+barom_psr+’ ‘+pressure_units+’, ‘+barom_state+’
Dewpoint: ‘+dewpoint+’ ‘+temp_units+’
UV: ‘+uv_state+’, ‘+uv_index+’
Sunrise: ‘+sunrise+’
Sunset: ‘+sunset+’
Moon: ‘+moon_state+’
Time Zone: ‘+time_zone+’ GMT’+’
storm:’+storm_watch+’
High: ‘+high_temp+’ ‘+temp_units+’
Low: ‘+low_temp+’ ‘+temp_units+’
Conditions: ‘+cloud_type+’
Precipitation: ‘+precipitation+’ %’+’
Wind: ‘+wind_speed+’ ‘+speed_units+’, ‘+wind_gust+’ ‘+speed_units+’ gusts, ‘+wind_dir+’
Humidity: ‘+humidity+’ %’+’
Sunrise: ‘+sunrise+’
Sunset: ‘+sunset+’
—————————————————————————

Another way to grab weather infomation in Conky

${execi 1800 (Yr Folder)~/.conky/scripts/weather.sh CAXX0255}

create two files weather.sh, weather.xslt
put these two under ./conky/scripts/ folder

edit your weather.sh file as

#!/bin/sh

#
# Grab weather data from weather.com and format it according to the given XSLT
# Script written by boojit
# Modified by Hellf[i]re
# The orignal script and xslt can be downloaded from http://pondol.com/weather.tar.gz

# Usage:
# ${execi 1800 /path/to/weather/weather.sh location}
# Usage Example:
# ${execi 1800 /home/harryc/downloads/weather/weather.sh USNY1175}

# your Location ID: use http://xoap.weather.com/search/search?where=%5Byourcity%5D to find it
# U.S. users can just use their zip code; doubt that works for anyone else though (YMMV)
LOCID=$1

# s=standard units, m=metric units
UNITS=m

# where this script and the XSLT lives
RUNDIR=/home/olo/.conky/scripts

# there’s probably other stuff besides CURL that will work for this, but i haven’t
# tried any others.
# you can get curl at http://curl.haxx.se/
CURLCMD=/usr/bin/curl

# get it at http://xmlsoft.org/XSLT/
XSLTCMD=/usr/bin/xsltproc

# you probably don’t need to modify anything below this point….

# CURL url. Use cc=* for current forecast or dayf=10 to get a multi-day forecast
CURLURL=”http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS&dayf=5&link=xoap&prod=xoap&par=[PartnerID]&key=[LicenseKey]
# sign up here http://www.weather.com/servic
es/xmloap.html
and get your PartnerID and LicenseKey


# The XSLT to use when translating the response from weather.com
# You can modify this xslt to your liking
XSLT=$RUNDIR/weather.xslt

#filter (if you want to convert stuff to lower-case or upper case or something)
#FILTER=”|gawk ‘{print(tolower($0));}’”

#####
eval “$CURLCMD ”$CURLURL” 2>/dev/null| $XSLTCMD $XSLT – $FILTER”

edit weather.xslt as:

<!–

This XSLT is used to translate an XML response from the weather.com
XML API.

You can format this file to your liking. Two things you may feel
like doing:

1) Modify the layout of the fields or static text already defined
2) Add other fields from the XML response file that aren’t referenced in this
XSLT. You can grab a full list by just doing a:
wget “http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS”
(change $LOCID and $UNITS to suit your needs)
–>

<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” version=”1.0″ >
<xsl:output method=”text” disable-output-escaping=”yes”/>
<xsl:template match=”weather”>
<xsl:apply-templates select=”cc”/>
<xsl:apply-templates select=”dayf/day[@d=’1′]“/>
</xsl:template>

<xsl:template match=”cc”>
<xsl:value-of select=”obst”/>  <xsl:text> 
</xsl:text><xsl:value-of select=”tmp”/><xsl:value-of
select=”/weather/head/ut”/><xsl:text>
</xsl:text><xsl:value-of select=”t”/>
</xsl:template>
<xsl:template match=”dayf/day[@d=’1′]“>

<xsl:text>  Tomorrow:
</xsl:text><xsl:value-of select=”low”/><xsl:value-of
select=”/weather/head/ut”/><xsl:text> to
</xsl:text><xsl:value-of select=”hi”/><xsl:value-of
select=”/weather/head/ut”/><xsl:text>,
</xsl:text><xsl:value-of
select=”part[@p=’d’]/t”/><xsl:text> 
</xsl:text><xsl:value-of
select=”/weather/swa/a/t”/><xsl:text></xsl:text>

</xsl:template>
</xsl:stylesheet>

if you have two X environment like fluxbox and gnome, and also you want two conky configuration file
then use -c to seperate them

conky -c .conkyrc
conky -c .gnomeconkyrc

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s