Subject: | Support for different regional versions |
Date: | Sat, 13 Feb 2010 18:23:41 +0100 |
To: | bug-Yahoo-Search [...] rt.cpan.org |
From: | Hendrik Weimer <hendrik [...] enyo.de> |
Hi,
I have added support for different regional versions of the Yahoo!
search engine (such as de.search.yahoo.com). Please see the attached
patch file.
Hendrik
--- Yahoo-Search-1.10.13/lib/Yahoo/Search.pm 2007-03-20 09:53:32.000000000 +0100
+++ Yahoo-Search/lib/Yahoo/Search.pm 2010-02-13 18:19:17.000000000 +0100
@@ -64,6 +64,7 @@
Language => undef,
Country => undef,
License => undef,
+ Region => undef,
},
QueryOptional => 1,
@@ -627,6 +628,7 @@
PostalCode => $allow_postal_code,
Language => $allow_language_code,
Country => $allow_country_code,
+ Region => $allow_country_code,
Mode => sub { $allow_from_hash->(0, $Config{$_[0]}->{AllowedMode}, @_) },
Sort => sub { $allow_from_hash->(0, $Config{$_[0]}->{AllowedSort}, @_) },
@@ -777,6 +779,7 @@
Mode => 'type',
PostalCode => 'zip',
Radius => 'radius',
+ Region => 'region',
Sort => 'sort',
Start => 'start',
State => 'state',
@@ -1290,6 +1293,7 @@
AllowAdult [X] [X] [X] . . . . .
Type [X] [X] [X] . . . . .
Language [X] . . [X] . . . .
+ Region [X] . . . . . . .
Sort . . . [X] [X] . . .
Color . [X] . . . . . .
.
@@ -1435,6 +1439,44 @@
supported by Yahoo!'s web services, a "400 Bad Request" error is returned
in C<@$>.
+=item Region
+
+Uses a different regional version of the Yahoo! web service. For
+example, setting C<Region> to "de" will show the results as returned
+from de.search.yahoo.com. Note that this does not restrict the results
+in the way C<Country> and C<Language> do, but will merely lead to a
+different weighting of the results. As of this writing, the Yahoo! web
+services support the following codes for C<Region>:
+
+ code country
+ ---- ---------------
+ ar Argentina
+ au Australia
+ at Austria
+ br Brazil
+ ca Canada
+ ct Catalan
+ dk Denmark
+ fi Finland
+ fr France
+ de Germany
+ in India
+ id Indonesia
+ it Italy
+ my Malaysia
+ mx Mexico
+ nl Netherlands
+ no Norway
+ ph Phillipines
+ ru Russian Federation
+ sg Singapore
+ es Spain
+ se Sweden
+ ch Switzerland
+ th Thailand
+ uk United Kingdom
+ us United States (yahoo.com)
+
=item License
For C<Doc> searches, can be: