| 1 | package Net::isoHunt; | ||
| 2 | 2 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | $Net::isoHunt::VERSION = '0.102770'; | |
| 4 | } | ||
| 5 | |||
| 6 | # ABSTRACT: Access isohunt.com from Perl | ||
| 7 | |||
| 8 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 2 | ▶ | use Net::isoHunt::Request; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 2 | ▶ | use Net::isoHunt::Response; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 2 | ▶ | use Net::isoHunt::Response::Image; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 2 | ▶ | use Net::isoHunt::Response::Item; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 1 | ▶ | sub prepare_request { |
|
Subroutine
prepare_request: called CC=1 SCAR=0.0
Pod
documented
| |||
| 16 | 1 | my $self = shift; | |
| 17 | 1 | return Net::isoHunt::Request->new(@_); | |
| 18 | } | ||
| 19 | |||
| 20 | 2 | __PACKAGE__->meta()->make_immutable(); | |
| 21 | |||
| 22 | 2 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | |||
| 24 | 2 | 1; | |
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | =pod | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Net::isoHunt - Access isohunt.com from Perl | ||
| 33 | |||
| 34 | =head1 VERSION | ||
| 35 | |||
| 36 | version 0.102770 | ||
| 37 | |||
| 38 | =head1 SYNOPSIS | ||
| 39 | |||
| 40 | use Net::isoHunt; | ||
| 41 | |||
| 42 | my $ih = Net::isoHunt->new(); | ||
| 43 | |||
| 44 | my $ih_request = $ih->prepare_request( { 'ihq' => 'ubuntu' } ); | ||
| 45 | $ih_request->start(21); | ||
| 46 | $ih_request->rows(20); | ||
| 47 | $ih_request->sort('seeds'); | ||
| 48 | |||
| 49 | my $ih_response = $ih_request->execute(); | ||
| 50 | |||
| 51 | print 'Title: ', $ih_response->title(), "\n"; | ||
| 52 | print 'Description: ', $ih_response->description(), "\n"; | ||
| 53 | |||
| 54 | my $image = $ih_response->image(); | ||
| 55 | print 'Image title: ', $image->title(), "\n"; | ||
| 56 | print 'Image URL: ', $image->url(), "\n"; | ||
| 57 | |||
| 58 | my @items = @{ $ih_response->items() }; | ||
| 59 | my $item = shift @items; | ||
| 60 | |||
| 61 | =head1 ATTRIBUTES | ||
| 62 | |||
| 63 | =head2 C<new> | ||
| 64 | |||
| 65 | Constructs and returns a L<Net::isoHunt> object. | ||
| 66 | |||
| 67 | =head1 METHODS | ||
| 68 | |||
| 69 | =head2 C<prepare_request> | ||
| 70 | |||
| 71 | Returns a L<Net::isoHunt::Request> object based on the arguments passed. Accepts | ||
| 72 | a hash reference. Valid arguments are listed in L<Net::isoHunt::Request>. C<ihq> | ||
| 73 | is required. | ||
| 74 | |||
| 75 | =head1 AUTHOR | ||
| 76 | |||
| 77 | Alan Haggai Alavi <alanhaggai@alanhaggai.org> | ||
| 78 | |||
| 79 | =head1 COPYRIGHT AND LICENSE | ||
| 80 | |||
| 81 | This software is copyright (c) 2010 by Alan Haggai Alavi. | ||
| 82 | |||
| 83 | This is free software; you can redistribute it and/or modify it under | ||
| 84 | the same terms as the Perl 5 programming language system itself. | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | |||
| 89 | __END__ | ||