First, like all non-standard Perl modules, you will need to install WWW::Myspace from CPAN, and then you can include it at the top of your Perl programs with the use statement:
use WWW::Myspace;After that, creating a MySpace object is as simple as logging in:
my $myspace = WWW::Myspace->new($account, $password);Let's say you want to get a list of all your friends, or the HTML profile of one of your friends.
@friends = $myspace->get_friends;You can even automatically post messages to your friends profiles.
foreach (@friends) {
$friend = $myspace->get_profile($_);
print $friend->content;
}
$result = $myspace->post_comment(FRIEND_ID, 'Howdy, folks!');Download it and give it a try. No good Perl hacker should have to do things that could easily be automated! Module Links:
