#!/usr/local/bin/perl # listsubs.cgi # # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. use strict; # Configration variables --------------- my $username = 'メールアドレス'; my $password = 'パスワード'; # Built-in variables ------------------- my $host = 'rpc.bloglines.com:80'; my $realm = 'Bloglines RPC'; my $regexp = ''; # -------------------------------------- use CGI qw(:standard); use HTML::Template; use LWP::UserAgent; my $data = join "", ; my $tmpl = HTML::Template->new( scalarref => \$data, die_on_bad_params => 0, ); my $ua = LWP::UserAgent->new(); $ua->credentials($host, $realm, $username, $password); my $res = $ua->get("http://rpc.bloglines.com/listsubs"); if ($res->is_success) { my @items; foreach (split(/\r?\n/, $res->content)) { if (m!$regexp! and $5 > 0) { push @items, { title => $1, htmlUrl => $2, xmlUrl => $3, subid => $4, unread => $5, }; } } if (scalar(@items) > 0) { $tmpl->param( error => 0, items => \@items, ); } else { $tmpl->param( error => 1, message => "Unread article is not found.", ); } } else { $tmpl->param( error => 1, message => $res->message, ); } print header( -type => 'text/html', -charset => 'UTF-8', ), $tmpl->output; exit; __DATA__ My Bloglines

My Bloglines


Powered by Bloglines Web Services