| Net-Douban documentation | view source | Contained in the Net-Douban distribution. |
Net::Douban::Atom - Atom parser
version 1.07
use Net::Douban::Atom;
my $feed = Net::Douban::Atom->new(\$xml);
$feed->title;
$feed->id;
$feed->get('db:uid');
$feed->content;
my @entries = $feed->entries;
This is the parser of douban.com xml based on XML::Atom::Feed and Moose
Many functions not listed here are documented in XML::Atom::Feed
$feed = Net::Douban::Atom->new(\$xml);
Constructor, even though XML::Atom::Feed support feed auto-discovery from internet, I do not recommend to do that.
$feed->get('title');
$feed->get('db:uid');
$feed->get('db','uid');
$feed->get($ns,'uid');
XML::Atom::Base::get的重载,当没有NS给出时,尽量‘聪明的’猜测对应NS
$feed->searchInfo();
返回搜索结果的信息
$feed->entries;
返回当前feed的所有entry
$feed->entry;
返回根entry,应用与情况为feed的root note是entry,即只是获得单个结果的情况(如获得一部电影信息,获得一个用户的信息等)。尽管这时$feed->whaterver也能获得相当多的结果,但仍然强烈建议使用$feed->entry->whatever来获得对应结果。此外,Net::Douban::Entry提供了比Atom更多的特性
woosley.xu<redicaps@gmail.com>
Copyright (C) 2010 by Woosley.Xu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
| Net-Douban documentation | view source | Contained in the Net-Douban distribution. |