I'm trying to pull just part of this page:http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Fayetteville&site=RAH&State=NC&warnzone=NCZ088Namely, just the "Weather" and "Temp". I'd like to do it in-line with PHP, but I can't seem to get it to cooperate. I'm not above using an intermediate page processed and cached to feed the information, but I'm trying to avoid it.Any ideas?
9/2/2010 1:45:01 PM
You know the NWS has a public XML feed you can grab, right?http://www.nws.noaa.gov/xml/Here is my PHP implementation, which you are welcome to modify as needed:
<?php$xslDoc = new DOMDocument();$xslDoc->load("./nwsweather.xslt");$xmlDoc = new DOMDocument();$xmlDoc->load('http://www.weather.gov/xml/current_obs/KRDU.xml');$proc = new XSLTProcessor();$proc->importStylesheet($xslDoc);echo $proc->transformToXML($xmlDoc);?>
9/2/2010 1:46:12 PM
no, no I did not know they published via XML. In fact I have an RSS reader that can rip through this for breakfast.THANK YOU /thread[Edited on September 2, 2010 at 1:53 PM. Reason : they need to make the stuff I want easier to locate ]
9/2/2010 1:53:29 PM
9/2/2010 3:29:46 PM
You're right! But it was entirely redundant, and I didn't actually do anything with the resource it retrieved.
9/2/2010 4:12:10 PM
i do all my http requests in socketswell technically i write assembly-generating php that makes http requests using sockets
9/2/2010 4:16:09 PM
GET OUT
9/2/2010 4:16:38 PM
More like "suck-its".
9/2/2010 4:17:56 PM
9/2/2010 4:18:24 PM
you can never understand it 'cause it happens too fastand it feels so good, it's like walking on glass
9/2/2010 11:05:30 PM