Problem with perl wrapper?
arjunrc
Registered Users Posts: 159 Major grins
Hi, I am getting my feet wet with the perl wrapper for Smugmug.
It's logging in fine, but when I Try and print my albums its empty. I have one album called 'World' - why is it not showing up?
The output is:
Logging into SmugmugLogin result is ok
It's logging in fine, but when I Try and print my albums its empty. I have one album called 'World' - why is it not showing up?
print "Logging into Smugmug"; my $sm_api = WWW::SmugMug::API->new( { sm_api_key => $mykey, secure => 1, } ); $rv=$sm_api->login_withPassword( { EmailAddress => 'my@email.com', Password => 'mypassword', } ); print "Login result is ", $rv->{'stat'},"\n"; my $albums = $sm_api->albums_get(); foreach my $album (@{$albums->{'Albums'}}) { $title=$album->{'title'}; print $title; }
The output is:
Logging into SmugmugLogin result is ok
0
Comments
How come login worked then?
Also, I found and older thread where someone posted you need to associate a cookie file to it. I know how to associate it to a user agent (LWP), but how do you connect it to $sm_api variable? Sorry, my knowledge of perl is very basic :-)
To link it to a cookies file, you need to use the ua element of sm_api_key like so. This may help other folks using perl: