NAME

WebService::Shutterstock::SearchResults - Class representing a single page of search results from the Shutterstock API

VERSION

version 0.004

SYNOPSIS

my $search = $shutterstock->search(searchterm => 'butterfly');

# grab results a page at a time
my $results = $search->results;
my $next_results = $search->next_page;

# or use an iterator
my $iterator = $search->iterator;
while(my $result = $iterator->()){
	# ...
}

ATTRIBUTES

query

A HashRef of the arguments used to perform the search.

type

Indicates whether these are "image" or "video" search results.

page

The current page of the search results (0-based).

count

The total number of search results.

sort_method

The sort method used to perform the search.

METHODS

results

Returns an ArrayRef of WebService::Shutterstock::SearchResult::Image or WebService::Shutterstock::SearchResult::Video objects for this page of search results (based on the type of this set of search results).

iterator

Returns an iterator as a CodeRef that will return results in order until all results are exhausted (walking from one page to the next as needed).

See the SYNOPSIS for example usage.

next_page

Retrieves the next page of search results (represented as a WebService::Shutterstock::SearchResults object). This is just a shortcut for specifying a specific page_number in the arguments to the search method.

AUTHOR

Brian Phillips <bphillips@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Brian Phillips and Shutterstock, Inc. (http://shutterstock.com).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.