Php Zend_提要实体和冒号分隔键
我创建了一个函数,它使用Zend_提要从Flickr中获取RSS提要。 不幸的是,我正在努力提取一些密钥 我可以通过回声得到Php Zend_提要实体和冒号分隔键,php,zend-framework,rss,zend-feed,Php,Zend Framework,Rss,Zend Feed,我创建了一个函数,它使用Zend_提要从Flickr中获取RSS提要。 不幸的是,我正在努力提取一些密钥 我可以通过回声得到之类的东西 $entry->title(); 但是我怎样才能呼应出像这样的内容呢 我相信有一个完全简单的方法可以做到这一点,但我一辈子都想不出来 下面是一个示例条目 <entry> <id>http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A</id> <publishe
$entry->title();
但是我怎样才能呼应出像<entry>
<id>http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A</id>
<published>2009-09-16T11:51:20.000Z</published>
<updated>2009-09-18T02:37:35.000Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/>
<category scheme='http://gdata.youtube.com/schemas/2007/categories.cat' term='Games' label='Gaming'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='torchlight'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='vanquisher'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='mmo'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='mmorpg'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='massively'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='multiplayer'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='online'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='game'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='mmohub'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='hub'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='forums'/>
<category scheme='http://gdata.youtube.com/schemas/2007/keywords.cat' term='reviews'/>
<title type='text'>Torchlight - Vanquisher Gameplay</title>
<content type='text'>I'm so excited to reveal the latest trailer for Torchlight, featuring the third class, the Vanquisher!</content>
<link rel='alternate' type='text/html' href='http://www.youtube.com/watch?v=T-Pq6QSeH7A&feature=youtube_gdata'/>
<link rel='http://gdata.youtube.com/schemas/2007#video.responses' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A/responses'/>
<link rel='http://gdata.youtube.com/schemas/2007#video.related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A/related'/>
<link rel='http://gdata.youtube.com/schemas/2007#mobile' type='text/html' href='http://m.youtube.com/details?v=T-Pq6QSeH7A'/>
<link rel='self' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/mmolifetv/uploads/T-Pq6QSeH7A'/>
<author>
<name>mmolifetv</name>
<uri>http://gdata.youtube.com/feeds/api/users/mmolifetv</uri>
</author>
<gd:comments>
<gd:feedLink href='http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A/comments' countHint='0'/>
</gd:comments>
<media:group>
<media:category label='Gaming' scheme='http://gdata.youtube.com/schemas/2007/categories.cat'>Games</media:category>
<media:content url='http://www.youtube.com/v/T-Pq6QSeH7A?f=user_uploads&app=youtube_gdata' type='application/x-shockwave-flash' medium='video' isDefault='true' expression='full' duration='97' yt:format='5'/>
<media:content url='rtsp://rtsp2.youtube.com/CigLENy73wIaHwmwH54E6erjTxMYDSANFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='97' yt:format='1'/>
<media:content url='rtsp://rtsp2.youtube.com/CigLENy73wIaHwmwH54E6erjTxMYESARFEgGUgx1c2VyX3VwbG9hZHMM/0/0/0/video.3gp' type='video/3gpp' medium='video' expression='full' duration='97' yt:format='6'/>
<media:description type='plain'>I'm so excited to reveal the latest trailer for Torchlight, featuring the third class, the Vanquisher!</media:description>
<media:keywords>torchlight, vanquisher, mmo, mmorpg, massively, multiplayer, online, game, mmohub, hub, forums, reviews</media:keywords>
<media:player url='http://www.youtube.com/watch?v=T-Pq6QSeH7A&feature=youtube_gdata'/>
<media:thumbnail url='http://i.ytimg.com/vi/T-Pq6QSeH7A/2.jpg' height='90' width='120' time='00:00:48.500'/>
<media:thumbnail url='http://i.ytimg.com/vi/T-Pq6QSeH7A/1.jpg' height='90' width='120' time='00:00:24.250'/>
<media:thumbnail url='http://i.ytimg.com/vi/T-Pq6QSeH7A/3.jpg' height='90' width='120' time='00:01:12.750'/>
<media:thumbnail url='http://i.ytimg.com/vi/T-Pq6QSeH7A/0.jpg' height='240' width='320' time='00:00:48.500'/>
<media:title type='plain'>Torchlight - Vanquisher Gameplay</media:title>
<yt:duration seconds='97'/>
</media:group>
<gd:rating average='5.0' max='5' min='1' numRaters='1' rel='http://schemas.google.com/g/2005#overall'/>
<yt:statistics favoriteCount='0' viewCount='24'/>
http://gdata.youtube.com/feeds/api/videos/T-Pq6QSeH7A
2009-09-16T11:51:20.000Z
2009-09-18T02:37:35.000Z
火炬之光-征服者游戏
我很高兴能展示最新的《火炬之光》预告片,这部预告片的主角是第三流的《征服者》!
mmolifetv
http://gdata.youtube.com/feeds/api/users/mmolifetv
游戏
我很高兴能展示最新的《火炬之光》预告片,这部预告片的主角是第三流的《征服者》!
手电筒、征服者、mmo、mmorpg、大型、多人、在线、游戏、mmohub、hub、论坛、评论
火炬之光-征服者游戏
我想从条目中提取第一个缩略图url。$entry->media()->thumbnail()
可以工作或
$entry->{'media:thumbnail'}
但是我不是100%确定。键中的冒号表示正在使用名称空间。media one在XML中的其他地方定义为指向yahoo域,在RSS中很常见。 Zend_提要有时会删除名称空间,所以您是否尝试过$entry->thumbnail() 或者,我记得有一个
getDom
方法将返回一个DOMDocument,您可以在其中使用所有内置的NS匹配方法(getelementsbytagnames
)
或者,看看新的Zend_Feed_阅读器——它可能已经支持媒体名称空间,或者编写自己的适配器非常简单——文档中有一个例子,亚马逊在他们的一些提要中包含ISBN,你可以复制。我用Zend Gdata YouTube解决了这个问题,我仍然感兴趣的是如何做到这一点,虽然我可能会使用Zend_饲料在未来的类似事情 不幸的是,这两种方法似乎都不起作用。谢谢你的想法!Zend_Feed_Reader确实支持名称空间的属性。你有一个例子可以说明我如何使用getDom方法吗?