#!/usr/bin/perl -w use strict; use XMLRPC::Lite; my $url = shift; my $service = 'http://www.blogcensus.net/census_server.pl'; my %known_methods = ( isBlog => 1, getLanguage => 1, getGenerator => 1, getOutgoingLinkCount => 1, getIncomingLinkCount => 1, crawledSince => 1, ); my $ref = rpc( 'crawledSince', $url ); foreach my $x ( @$ref ) { print join " ", @$x, "\n"; } #exit; die "URL $url did not match a known blog " unless rpc( 'isBlog', $url ); print "Language is ", rpc( 'getLanguage', $url ), "\n"; print "Generated by ", rpc( 'getGenerator', $url ), "\n"; print "Incoming Links ", rpc( 'getIncomingLinkCount', $url ), "\n"; print "Outgoing Links ", rpc( 'getOutgoingLinkCount', $url ), "\n"; sub rpc { my ( $method ) = @_; die "invalid method " unless exists $known_methods{ $method }; return XMLRPC::Lite -> proxy($service) -> call("BlogCensus.$method", $url ) -> result; }