<slide title="Yahoo Query Language - YQL">

<break lines="1"/>

<example result="1" hide="1" fontsize="1.4em"><![CDATA[<?php
include 'presentations/slides/intro/yql.php';
if(!empty($_POST['loc'])) $loc = htmlspecialchars($_POST['loc'], ENT_QUOTES, 'UTF-8');
else $loc=':-:location:-:';
?>
<form action="<?php echo htmlspecialchars($PHP_SELF)?>" method="POST">
select * from wunderground.forecast where location = "<input autocomplete="off" style="font-size: 24px;" type=text name=loc value="<?php echo $loc?>" size=14>"
</form>
<?php
$x = yql("select * from wunderground.forecast where location='$loc'");
$f = $x->results->forecast->simpleforecast;
echo "<br />\n";
foreach($f->forecastday as $w) {
  echo '<img style="float:left;" src="'.((string)$w->icons->icon_set[0]->icon_url).'"/>';
  echo $w->date->weekday.' '.$w->date->monthname.' '.$w->date->day." &nbsp; &nbsp; ";
  echo $w->conditions."<br />\n";
  echo "low: {$w->low->celsius}°C ({$w->low->fahrenheit}F) high: {$w->high->celsius}°C ({$w->high->fahrenheit}F)";
  echo "<br />\n<br />\n";
}
?>]]></example>

</slide>
