Quick and Dirty "Show me the latest 5 photos in my stream" script
Posted by Doomshammer
on Tuesday, October 14. 2008
at 15:01
in Anwendungen, English only, Photography, Privat, Thoughts
Here is a brief example of how to quickly fetch the latest 5 photos in you photostream and put them into a quick and dirty HTML output. It is written in Perl and uses my Ipernity::API moduleView it as plain text
QUOTE:
#!/usr/bin/perl -w
use strict;
use warnings;
use Ipernity::API;
my $api = Ipernity::API->new(
'args' => {
'api_key' => '0123456123451234651235123452345234',
'outputformat' => 'xml',
},
);
my $result = $api->execute_xml(
'method' => 'doc.search',
'share' => 4,
'per_page' => 5,
'media' => 'photo',
'user_id' => '',
);
foreach my $doc (@{$result->{docs}->{doc}}) {
print '' .
'
\n";
}
use strict;
use warnings;
use Ipernity::API;
my $api = Ipernity::API->new(
'args' => {
'api_key' => '0123456123451234651235123452345234',
'outputformat' => 'xml',
},
);
my $result = $api->execute_xml(
'method' => 'doc.search',
'share' => 4,
'per_page' => 5,
'media' => 'photo',
'user_id' => '
);
foreach my $doc (@{$result->{docs}->{doc}}) {
print '' .
'
\n";
}


