#!/bin/bash # weather--Gets the weather for a specific region or ZIP code. if test $Argc -ne 1 { echo "Usage: $0 " exit 1 } setglobal apikey = '"b0304b43b2e7cd23'" # Not a real API key--you need your own. setglobal weather = $[curl -s \ "https://api.wunderground.com/api/$apikey/conditions/q/$1.xml] setglobal state = $[xmllint --xpath \ //response/current_observation/display_location/full/text'('')' \ $[echo $weather]] setglobal zip = $[xmllint --xpath \ //response/current_observation/display_location/zip/text'('')' \ $[echo $weather]] setglobal current = $[xmllint --xpath \ //response/current_observation/temp_f/text'('')' \ $[echo $weather]] setglobal condition = $[xmllint --xpath \ //response/current_observation/weather/text'('')' \ $[echo $weather]] echo $state" ("$zip") : Current temp "$current"F and "$condition" outside."