tag:blogger.com,1999:blog-4471993488623327927.post367500918057421322..comments2024-03-13T06:57:54.343+00:00Comments on Obnoxio The Clown: There's geeky ...Obnoxio The Clownhttp://www.blogger.com/profile/12012089552153702526noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4471993488623327927.post-55665062218567314682010-01-09T19:33:46.925+00:002010-01-09T19:33:46.925+00:00There Ain't Half Been Some Clever Bastards.
Jo...There Ain't Half Been Some Clever Bastards.<br />John GibsonAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4471993488623327927.post-7085371497874677772010-01-05T21:10:56.778+00:002010-01-05T21:10:56.778+00:00Bit verbose. I turned it into a function that take...Bit verbose. I turned it into a function that takes a URL and fills an array:<br /><br />function get_weather($url,&$warr)<br />{<br />$warr=array(); if(($wdata=file_get_contents($url))!==false){<br />$wtags=array("Temperature", "Wind Speed", "Humidity", "Rain Today");<br />foreach($wtags as $k){<br />if(($spos=stripos($wdata,$k.":"))!==false)<br />$warr[$k]=preg_replace("([^0-9.])", "", strip_tags(html_entity_decode(htmlspecialchars_decode(substr($wdata,$spos+strlen($k),30)))));<br />}<br />}<br />return(!empty($warr));<br />}<br /><br />Simples!David Gilliesnoreply@blogger.comtag:blogger.com,1999:blog-4471993488623327927.post-75932233756385620592010-01-05T12:48:33.477+00:002010-01-05T12:48:33.477+00:00I'm a bit of a Linux nut myself, but this - to...I'm a bit of a Linux nut myself, but this - too much, even for me!<br /><br />Thanks all the same, the other info on prompts was useful.opsimathnoreply@blogger.com