This widget displays the current condition, temperature, and the feels like temperature. It uses weather.com’s xoap api to retrieve the information.
The location can either be a zip code for US users or the locid. To find the locid, you can do a search using http://xoap.weather.com/search/search?where=[search parameters].This will return an XML file with search results and their corresponding locid’s.
You can also find it using the Weather.com website. After searching for and selecting your city, you will be sent to a url that will look something like, http://www.weather.com/outlook/driving/interstate/local/USTX0617?from=search_city, where USTX0617 is the locid.
I’ve provided the images used and provided by weather.com here. If you want to host your own images, extract and upload the files, then, in the admin panel, edit the ‘Image Location’ field to point to your directory of images. Make sure to have the trailing slash.
If you don’t use your own images, you are free to use the ones that I’ve hosted, which are located at http://nothingoutoftheordinary.com/weatherimages/
You can edit ‘Widget Formatting’ to change how the info is displayed. To access the variables, use this formatting:
The default formatting is:
<img src=”%iconhref%” alt=”%cond%” style=”float:right;” />
%loc%<br />
<span style=”font-size: 150%;”>%temp% °F</span>
(%feels% °F)<br />
<span style=”font-size: 65%; float: right;”>%attribution%</a>
This script relies on the function file_get_contents to fetch the RSS feed. If your host doesn’t allow the use of it, but allows the use of curl, you can replace
$stories = file_get_contents($uri);
with
$ch = curl_init(); $timeout = 5; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $uri); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $stories = curl_exec($ch); curl_close($ch);
It’s the number of seconds before the content will be requested again. You can set this to be 0 or -1 to not use the caching system. If you edit any of the widgets in the widget admin panel, the cache is cleared.