Giter Club home page Giter Club logo

flickr-api2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flickr-api2's Issues

Missing response elements in photos->by_id method.

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.

Getting total photos

I'd like to get the total number of pictures retured from a search. I was able to access this (and some other things) in the search subroutine in Photos.pm, however I couldn't figure out how to return them with the photos.

Here's how I could access them:

my $page_info = {
        'total' => $r->{photos}->{total},
        'page' => $r->{photos}->{page},  
        'perpage' => $r->{photos}->{perpage}, 
        'pages' => $r->{photos}->{pages},
};

my @results =  $self->_response_to_photos($r->{photos});
push( @results, $page_info );
return @results;

This returned an array containing a hash and an array of hashes. I couldn't figure out an elegant way to access the info though.

How to die gracefully

Please do not die in libraries with die "$message\n".

I had a program that failed with API call failed with HTTP status: 403. The problem was that I was using a number of API calls in this program and it was most unclear as to which API had failed.

I finally tracked it down (with grep) to https://github.com/TJC/Flickr-API2/blob/master/lib/Flickr/API2/Raw.pm#L132-L133

die("API call failed with HTTP status: " . $response->code . "\n")
    unless $response->code == 200;

Please either use croak or at least leave out the \n so that I can see which module failed.

Thanks.

Test UTF8 Handling

Ensure that UTF-8 encoded strings can make it to, and from, Flickr correctly.

Needs new maintainer

This module has been marked as "needs adoption" (by a new maintainer) on CPAN for some time now.

I'm not working with Perl much at all any more, and so this module's users would be better served by an active maintainer.

If you're interested, please comment on this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.