Skip to content

Instantly share code, notes, and snippets.

@codepo8
Created November 11, 2010 00:21
Show Gist options
  • Save codepo8/671769 to your computer and use it in GitHub Desktop.
Save codepo8/671769 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.0/build/reset-fonts-grids/reset-fonts-grids.css&2.8.0/build/base/base-min.css">
</head>
<body class="yui-skin-sam">
<div id="doc2" class="yui-t5">
<div id="hd" role="banner">
<h1></h1>
</div>
<div id="bd" role="main">
<?php
$moburl = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.slideshare.net%2Fmobile%2Fcheilmann%2Funderstanding-progressive-enhancement-yuiconf2010%22%20and%20xpath%3D%22%2F%2Fscript%5B1%5D%22&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys';
$url = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.slideshare.net%2Fcheilmann%2Funderstanding-progressive-enhancement-yuiconf2010%22%20and%20xpath%3D%22%2F%2Fol%22&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&format=xml&callback=moo';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$mo = preg_replace('/^moo\(/','',$output);
$mo = preg_replace('/\);/','',$mo);
$nav= json_decode($mo)->results[0];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $moburl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
preg_match_all('/"baseSlideUrl":"([^"]+)"/',$output,$slides);
preg_match_all('/"totalSlides":(\d+),/',$output,$numbers);
for($i=1;$i<=$numbers[1][0];$i++){
$slid.= '<img src="'.$slides[1][0].'-slide-'.$i.'.jpg">';
}
?>
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<?php echo $slid;?>
</div>
</div>
</div>
<div class="yui-b"><?php echo $nav;?></div>
</div>
<div id="ft" role="contentinfo">
<p></p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment