I have a project that I need to add many many videos, some of which are TED.com videos. Is there an easy way I can perform an AJAX, JSON, or cURL request to obtain this information? This information does not seem to be in the embed object.
that doesnt sound easy.
Talvi Watia
2010-07-27 11:05:40
It's not as hard as it sounds. You can use this library for parsing html: http://sourceforge.net/projects/simplehtmldom/ - I think the main problem is loading the page. It will, probably, kill your app performance. =\
CrociDB
2010-07-27 11:21:36
+1
A:
The site has an RSS feed that contains a lot of information, currently covering the last 112 lectures. For example, you could list direct links to the videos like this:
$url = 'http://feeds.feedburner.com/tedtalks_video';
$sxml = new SimpleXMLElement(file_get_contents($url));
foreach ($sxml->xpath('//item') as $item) {
$video_link = $item->enclosure->attributes()->url;
echo date('Y-m-d', strtotime($item->pubDate)) . '<br />'
. $item->title . '<br />'
. $item->description . '<br />'
. '<a href="' . $video_link . '">' . $video_link . '</a><br />'
. '------------------<br />';
}
GZipp
2010-07-27 17:11:49