CC: | "g1053007-group [...] doc.ic.ac.uk" <g1053007-group [...] doc.ic.ac.uk> |
Subject: | Patch to enable Google Image refinement search options |
Date: | Wed, 23 Mar 2011 08:08:55 +0000 |
To: | <bug-WWW-Google-Images [...] rt.cpan.org> |
From: | Kevin Keraudren <kevin.keraudren10 [...] imperial.ac.uk> |
Hi,
here are the modifications I did to
WWW-Google-Images-0.6.5/lib/WWW/Google/Images.pm
to enable Google Image refinement search options.
153a154,193
Show quoted text
> my $refine = 'ift:jpg,'; # only JPEG
> if ( $arg{large} ) {
> $refine .= 'isz:l,'
> }
> if ( $arg{medium} ) {
> $refine .= 'isz:m,'
> }
> if ( $arg{icon} ) {
> $refine .= 'isz:i,'
> }
> if ( $arg{face} ) {
> $refine .= 'itp:face,'
> }
> if ( $arg{photo} ) {
> $refine .= 'itp:photo,'
> }
> if ( $arg{clipart} ) {
> $refine .= 'itp:clipart,'
> }
> if ( $arg{lineart} ) {
> $refine .= 'itp:lineart,'
> }
> if ( $arg{color} ) {
> $refine .= 'ic:color,'
> }
> if ( $arg{gray} ) {
> $refine .= 'ic:gray,'
> }
>
> my $fields = {
> q => $query,
> tbs => 'isch:1,' . $refine,
> };
> if ($arg{nosafe}){
> $fields->{safe} = 'off';
> }
> if ($arg{strict}){
> $fields->{safe} = 'active';
> }
>
156,158c196
< fields => {
< q => $query
< }
---
Show quoted text > fields => $fields,
Kind regards,
Kevin Keraudren