WebService::Bloglines - Easy-to-use Interface for Bloglines Web Services
use WebService::Bloglines; my $bloglines = WebService::Bloglines->new( username => $username, password => $password, # password is optional for notify() use_liberal => 1, ); # get the number of unread items using Notifer API my $notifier = $bloglines->notify(); # list subscriptions using Sync API my $subscription = $bloglines->listsubs(); # list all feeds my @feeds = $subscription->feeds(); for my $feed (@feeds) { my $title = $feed->{title}; # title of the feed my $url = $feed->{htmlUrl}; # URL for HTML my $type = $feed->{type}; # "rss" my $xml = $feed->{xmlUrl}; # URL for XML my $subid = $feed->{BloglinesSubId}; # Blogines SubId my $unread = $feed->{BloglinesUnread}; # number of unread items my $ignore = $feed->{BloglinesIgnore}; # flag to ignore update } # list folders my @folders = $subscription->folders(); for my $folder (@folders) { my $title = $folder->{title}; # title of the folder my $unread = $folder->{BloglinesUnread}; # number of unread items my $subid = $folder->{BloglinesSubId}; # Bloglines SubId my $ignore = $folder->{BloglinesIgnore}; # flag to ignore update my @feeds = $subscription->feeds_in_folder($subid); } # list feeds in root folder my @root_feeds = $subscription->feeds_in_folder(); # no args or just use $subId = 0 # get new items using Sync API my $update = $bloglines->getitems($subId); # $update = $bloglines->getitems($subId, 1); # mark unread items as read # $update = $bloglines->getitems($subId, 1, $unixtime); # items from $unixtime # get channel information my $feed = $update->feed(); $feed->{title}; # channel/title $feed->{link}; # channel/link $feed->{description}; # channel/description $feed->{bloglines}->{siteid}; # bloglines::siteid $feed->{language}; # language for my $item ($update->items) { my $title = $item->{title}; my $creator = $item->{dc}->{creator}; my $link = $item->{link}; my $guid = $item->{guid}; my $description = $item->{description}; my $pubDate = $item->{pubDate}; # "Mon, 27 Sep 2004 8:04:17 GMT" my $itemid = $item->{bloglines}->{itemid}; } # get all unread items in a single call my @updates = $bloglines->getitems(0); for my $update (@updates) { my $feed = $update->feed(); for my $item ($update->items) { ... } }
WebService::Bloglines priovides you an Object Oriented interface for Bloglines Web Services (BWS). It currently supports Notifier API and Sync API. See http://www.bloglines.com/services/api/ for details.
TBD.
Cleaner API to make users free from the difference between OPML and RSS stuff
Use LibXML to parse OPML?
This module is in beta version. Object interface it provides may be changed later.
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.bloglines.com/
http://www.bloglines.com/services/api/
Blog Hacks: http://hacks.bloghackers.net/ (in Japanese)
To install WebService::Bloglines, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Bloglines
CPAN shell
perl -MCPAN -e shell install WebService::Bloglines
For more information on module installation, please visit the detailed CPAN module installation guide.