php - How can I extract the title and description of a TED.com video? -
i have project need add many many videos, of ted.com videos. there easy way can perform ajax, json, or curl request obtain information? information not seem in embed object.
the site has rss feed contains lot of information, covering last 112 lectures. example, list direct links videos this:
$url = 'http://feeds.feedburner.com/tedtalks_video'; $sxml = new simplexmlelement(file_get_contents($url)); foreach ($sxml->xpath('//item') $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 />'; }
Comments
Post a Comment