Drkcore

26 03 2009 perl Tweet

XML::FeedのContent

LDRでこのblogのフィードの本文が表示しなくなってしまい、なんでかなーと。

% perl -MXML::Feed\ 999  
XML::Feed version 999 required--this is only version 0.23.
BEGIN failed--compilation aborted.
% perl -MXML::RSS\ 999 
XML::RSS version 999 required--this is only version 1.43.
BEGIN failed--compilation aborted.

バージョンは上の通りで、

use XML::Feed;

my $feed = XML::Feed->new('RSS');
$feed->title( "test" );
$feed->link( 'http://www.kzfmix.com/rss' );
$feed->description("feed test");

my $feed_entry = XML::Feed::Entry->new('RSS');
$feed_entry->title('feed test');
$feed_entry->link('http://www.kzfmix.com/test');
$feed_entry->summary("test summary");
$feed->add_entry($feed_entry);

print $feed->as_xml;

を実行してみると

<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
 xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:dcterms="http://purl.org/dc/terms/"
>

<channel>
<title>test</title>
<link>http://www.kzfmix.com/rss</link>
<description>feed test</description>

<item>
<title>feed test</title>
<link>http://www.kzfmix.com/test</link>
<description>test summary</description>
<guid isPermaLink="true">http://www.kzfmix.com/test</guid>
<content:encoded> </content:encoded>
</item>
</channel>
</rss>

とスペース一個content要素が出来る。このせいかなと、contentに本文を入れて出力するように変更してみた。

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021