NAME
Net::Douban::Atom - Atom parser
VERSION
version 1.06
SYNOPSIS
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;
DESCRIPTION
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
METHODS
- new
-
$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.
- get
-
$feed->get('title'); $feed->get('db:uid'); $feed->get('db','uid'); $feed->get($ns,'uid');
XML::Atom::Base::get的重载,当没有NS给出时,尽量‘聪明的’猜测对应NS
- search_info
-
$feed->searchInfo();
返回搜索结果的信息
- entries
-
$feed->entries;
返回当前feed的所有entry
- entry
-
$feed->entry;
返回根entry,应用与情况为feed的root note是entry,即只是获得单个结果的情况(如获得一部电影信息,获得一个用户的信息等)。尽管这时$feed->whaterver也能获得相当多的结果,但仍然强烈建议使用$feed->entry->whatever来获得对应结果。此外,Net::Douban::Entry提供了比Atom更多的特性
- AUTOLOAD
-
$feed->whatever;
当遇到没有明确定义过的函数时,Net::Douban::Atom内部自动使用$self->get('whatever')
SEE ALSO
Net::Douban Moose XML::Atom http://douban.com/service/apidoc
AUTHOR
woosley.xu<redicaps@gmail.com>
COPYRIGHT
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.