Skip to content

Missing response elements in photos->by_id method. #5

Closed
@dbough

Description

@dbough

Wondering if there is a reason a large portion of elements aren't being returned by the by_id subroutine in the Photos.pm module?

sub by_id {
    my ($self, $id) = @_;
    my $p = Flickr::API2::Photo->new( api => $self->api, id => $id );
    my $info = $p->info->{photo};
    $p->title($info->{title}{_content});
    $p->description($info->{description}{_content});
    $p->owner_name($info->{owner}{realname});
    $p->owner_id($info->{owner}{nsid});
    $p->path_alias($info->{owner}{username});

    return $p;
}

I've modified this (and some portion of Photo.pm) so that I can get some elements I need for a project. Is there another way to get this info that I've missed?:

sub by_id {
    my ($self, $id) = @_;
    my $p = Flickr::API2::Photo->new( api => $self->api, id => $id );
    my $info = $p->info->{photo};
    $p->title($info->{title}{_content});
    $p->description($info->{description}{_content});
    $p->owner_name($info->{owner}{realname});
    $p->owner_id($info->{owner}{nsid});
    $p->path_alias($info->{owner}{username});
    $p->license($info->{license});
    $p->tags($info->{tags}{tag});
    $p->dates($info->{dates});

    return $p;
}

If not, I can tweak it a bit more and submit a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions