/ Published in: PHP
Uses the Magpie RSS library (http://magpierss.sourceforge.net/). I suppose I should be using the GData API, but this was a quicker solution for me.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
require_once('magpierss/rss_fetch.inc'); $rss = fetch_rss("http://www.youtube.com/rss/user/$username/videos.rss"); foreach ($rss->items as $item) { preg_match('/http:\/\/(.*)default.jpg/',$item['description'],$matches); $thumb = $matches[0]; $title = $item['title']; $link = $item['link']; $date = date("n/d/Y",strtotime($item['pubdate'])); ?> <div class="video"> <a href="<?php echo $link; ?>"><img src="<?php echo $thumb; ?>" /></a><br /> <strong><?php echo $title; ?></strong><br /> posted on <?php echo $date; ?> </div> <?php } ?>