File: set_random_photo

package info (click to toggle)
libwww-myspace-perl 0.82-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 728 kB
  • ctags: 170
  • sloc: perl: 4,646; makefile: 10
file content (18 lines) | stat: -rwxr-xr-x 453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w -I../lib

use WWW::Myspace 0.60;
my $myspace = new WWW::Myspace;

warn "Got myspace object.\n";
my @ids = $myspace->get_photo_ids;
print "@ids\n";
my $photo_num = int( rand( @ids ) );
my $photo_id = $ids[ $photo_num ];
print "Picked photo number $photo_num, photo_id $photo_id\n";
if ( $myspace->set_default_photo( photo_id => $photo_id ) ) {
	print "Set photo\n";
} else {
    print "Got error: ";
	print $myspace->error . "\n";
};