我遇到了这个RssDisplay但是我不确定它的用法以及它有多好.
解决方法 从 CPAN: XML::RSS::Parser.07001 is a lightweight liberal parser of RSS Feeds. This parser is “liberal” in that it does not demand compliance of a specific RSS version and will attempt to gracefully handle Tags it does not expect or understand. The parser’s only requirements is that the file is well-formed XML and remotely resembles RSS.
#!/usr/bin/perluse strict; use warnings;use XML::RSS::Parser;use fileHandle;my $parser = XML::RSS::Parser->new;unless ( -e 'uploads.rdf' ) { require LWP::Simple; LWP::Simple::getstore( 'http://search.cpan.org/uploads.rdf','uploads.rdf',);}my $fh = fileHandle->new('uploads.rdf');my $Feed = $parser->parse_file($fh);print $Feed->query('/channel/Title')->text_content,"\n";my $count = $Feed->item_count;print "# of Items: $count\n";foreach my $i ( $Feed->query('//item') ) { print $i->query('Title')->text_content,"\n";}总结
以上是内存溢出为你收集整理的我可以使用什么模块来解析Perl CGI脚本中的RSS源?全部内容,希望文章能够帮你解决我可以使用什么模块来解析Perl CGI脚本中的RSS源?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)