/ Published in: PHP
requires MagpieRSS. copy and paste into html head tag, then edit zipcode variable to reflect what weather you want to show.
Expand |
Embed | Plain Text
<?php $zipcode = 94704; require_once('magpierss/rss_fetch.inc'); $url = "http://rss.weather.com/weather/rss/local/" . $zipcode . "?cm_ven=LWO&cm_cat=rss&par=LWO_rss"; $rss = fetch_rss($url); foreach ($rss->items as $item) { $desc[] = $item['description']; } $icon = substr($desc[0],(stripos($desc[0], "src=")+5),(stripos($desc[0], "alt=\"\"")-(stripos($desc[0], "src=")+5)-2)); ?>
You need to login to post a comment.
