Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dbough opened this issue Apr 22, 2013 · 4 comments
Closed

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

dbough opened this issue Apr 22, 2013 · 4 comments

Comments

@dbough
Copy link
Contributor

dbough commented Apr 22, 2013

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.

@TJC
Copy link
Owner

TJC commented Apr 22, 2013

A pull request would be great, thanks.

TJC added a commit that referenced this issue Apr 26, 2013
Fixed some type-os in Base _response_to_photos & added attributes, added attributes to by_id in Photos as per issue #5
@TJC
Copy link
Owner

TJC commented Apr 26, 2013

Thanks for providing the patch. I'll make a new release to CPAN soon.
Did you have any plans for further patches? If so, I'll hold off on the new release for a while.

@dbough
Copy link
Contributor Author

dbough commented Apr 26, 2013

The only other piece that I'd like to address is in issue #8. I'm not smart enough to determine how to do it w/in this framework though =). Is it something you can look at? I can write the code if you have an idea on a direction.

@TJC
Copy link
Owner

TJC commented Apr 26, 2013

I have a couple of ideas around that, but won't have time to look at it until next week. I'll get back to it then, then.

@TJC TJC closed this as completed Sep 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants