The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Social::Mapper - utilities for dealing with internet persona

SYNOPSIS

    my $mapper   = Net::Social::Mapper->new;
    my $persona  = $mapper->persona('daveman692', 'livejournal');

    print $persona->user;    # daveman692
    print $persona->service; # livejournal
    print $persona->domain;  # livejournal.com
    print $persona->name;    # LiveJournal

    # Print out any feeds available (if any exist)
    print "Feeds : ".join(", ", @feeds);

    # What type are the feed items 
    print "Feeds contain : ".join(", ", $persona->types);

    # These other options may or may not be available
    print "Home page   : ".$persona->homepage;
    print "Profile url : ".$persona->profile;
    print "Full Name   : ".$persona->full_name;
    print "Service id  : ".$persona->id;
    print "Photo url   : ".$persona->photo;
    print "FOAF  url   : ".$persona->foaf;

    # If you have network access then you can query 
    # who they are elsewhere on the web
    my @personas = $persona->elsewhere;

    # Other examples ...

    my $persona  = $mapper->persona('daveman692', 'flickr');
    print $persona->user;    # daveman692
    print $persona->id;      # 36381329@N00

    my $persona  = $mapper->persona('http://davidrecordon.com');
    print $persona->user;    # http://davidrecordon.com 
    print $persona->service; # website
    print $persona->domain;  # davidrecordon.com

    my $persona  = $mapper->persona('test@example.com');
    print $persona->user;    # test@example.com
    print $persona->service; # email
    print $persona->id;      # test
    print $person->domain;   # example.com

    # Moreover Net::Social::Mapper tries to work out the service from the url so that  ...
    my $persona  = $mapper->persona('http://daveman692.livejournal.com');
    my $persona  = $mapper->persona('http://daveman692.livejournal.com/data/rss');
    my $persona  = $mapper->persona('http://daveman692.livejournal.com/data/atom');
    my $persona  = $mapper->persona('http://www.livejournal.com/userinfo.bml?user=daveman692');
    # ... all return 
    print $persona->user;    # daveman692
    print $persona->service; # livejournal
    print $persona->domain;  # livejournal.com
    print $persona->name;    # LiveJournal

METHODS

new

Get a new Net::Social::Mapper object.

persona <user> [service]

Return a Net::Social::Mapper::Persona object representing the user.

Returns undef if it doesn't know anything about the service.

sitemap

The Net::Social::Mapper::SiteMap object containing everything we know about various services.

classmap [key value]

Return a hash of (lowercase) service names to classes;

Alternatively if you pass in a key, value pair then that will be added to the map.

Passing in undef as the value will delete the key.

get <url>

Get the contents of the url or undef on failure;

AUTHOR

Simon Wistow <swistow@sixapart.com>

COPYRIGHT

Copyright 2008, Six Apart Ltd.

Released under the same terms as Perl itself.