Yahoo Pipes - 防止转义节点的文本

时间:2011-03-03 07:47:53

标签: rss escaping yahoo-pipes magnet-uri

我正在编写一个管道来重新映射RSS提要中的几个节点。

最近创建了一个新的torrent命名空间,并在一些提供bittorrent提要的网站上使用。 Feed中每个项目的torrent节点包含磁体/ URI,我正在尝试将其重新映射到媒体内容的链接,因此我的bittorrent客户端将默认下载而不是文件本身,因为我几乎可以保证它可以获得与DHT直接下载torrent文件不同,因为正常运行问题。

我设法正确地重新映射它,除了磁体uri在magnetURI节点中存储为CDATA。当管道处理它时,它会转出特定于uri的字符,如&符号。有没有办法强制管道按原样显示数据而不转义它?

以下是从其中一个Feed中提取的项目示例:

<item>
    <title><![CDATA[Some torrent title]]></title>
    <link>http://www.somebittorrentsite.com/fileofinterest.torrent</link>
    <pubDate>Mon, 21 Feb 2011 00:00:00 -0000</pubDate>
    <description><![CDATA[A torrent file you'd like to download.]]></description>
    <enclosure url="http://www.somebittorrentsite.com/fileofinterest.torrent" length="123456789" type="application/x-bittorrent" />
    <guid>912554a5-dd0e-4bee-b2ed-d776e0471552</guid>
    <torrent xmlns="http://xmlns.ezrss.it/0.1/">
        <fileName><![CDATA[fileofinterest.torrent]]></fileName>
        <contentLength>123456789</contentLength>
        <infoHash>E4799FF799F9C8C26BA087C601A732DF748FDFB0</infoHash>
        <magnetURI><![CDATA[magnet:?xt=urn:btih:E4799FF799F9C8C26BA087C601A732DF748FDFB0&dn=fileofinterest]]></magnetURI>
    </torrent>
</item>

一旦它穿过管道,其中所有内容都被重新映射,你可以在media:content中看到磁铁uri已被转义。

<item>
    <title>Some torrent title</title>
    <link>http://www.somebittorrentsite.com/fileofinterest.torrent</link>
    <description>A torrent file you'd like to download.</description>
    <guid isPermaLink="false">912554a5-dd0e-4bee-b2ed-d776e0471552</guid>
    <pubDate>Mon, 28 Feb 2011 19:44:07 -0800</pubDate>
    <media:content url="magnet:?xt=urn:btih:E4799FF799F9C8C26BA087C601A732DF748FDFB0&amp;amp;dn=fileofinterest" type="application/x-magnet"/>
</item>

1 个答案:

答案 0 :(得分:0)

YP设计用于NON程序员使用 human 可读文本,因此转换单个  '&' to '&amp;'是有道理的。

我唯一可以建议的是将管道传递给替换模块并以此方式将其交换。

相关问题