将视频链接字段添加到 RSS


Adding video link field to RSS

我正在尝试将视频链接添加到我的 RSS 字段。

例如。

这是我想从中提取视频链接的帖子的链接:http://topdailyfights.com/index.php/09/20/employee-goes-crazy-in-office/

我想要的链接在"视频包装"div 类中。

<div class="video-wrap"><div class='jwplayer' id='jwplayer-0'></div><script type='text/javascript'>if(typeof(jQuery)=="function"){(function($){$.fn.fitVids=function(){}})(jQuery)};jwplayer('jwplayer-0').setup({"aspectratio":null,"width":420,"height":315,"primary":"flash","file":"http://topdailyfights.com/wp-content/uploads/2013/09/office-worker-goes-crazy.mp4"});
</script></div>

这是我想要的链接:topdailyfights.com/wp-content/uploads/2013/09/office-worker-goes-crazy.mp4

我希望链接显示在每个提要下:http://topdailyfights.com/index.php/feed/

我该怎么做?

提要.php代码(如果有帮助):pastebin.com/sfHuPETv

谢谢大家!

前几天我在做类似的事情时偶然发现了一个很棒的类,它叫做simplehtmldom,你可以在这里得到它

简单演示:

// Create DOM from URL
$html = file_get_html('http://slashdot.org/');
// Find all article blocks
foreach($html->find('div.article') as $article) {
    $item['title']     = $article->find('div.title', 0)->plaintext;
    $item['intro']    = $article->find('div.intro', 0)->plaintext;
    $item['details'] = $article->find('div.details', 0)->plaintext;
    $articles[] = $item;
}
print_r($articles);