mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Also show 'generic' US results from Amazon for products in non-US locales to increase information coverage
git-svn-id: https://zxing.googlecode.com/svn/trunk@2916 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
1bcc298ad3
commit
bcda4676cc
|
@ -57,9 +57,17 @@ final class AmazonInfoRetriever extends SupplementalInfoRetriever {
|
|||
|
||||
@Override
|
||||
void retrieveSupplementalInfo() throws IOException {
|
||||
doRetrieveForCountry(country);
|
||||
if (!"US".equals(country)) {
|
||||
// Also show US results to expand scope of results
|
||||
doRetrieveForCountry("US");
|
||||
}
|
||||
}
|
||||
|
||||
private void doRetrieveForCountry(String theCountry) throws IOException {
|
||||
|
||||
CharSequence contents =
|
||||
HttpHelper.downloadViaHttp("https://bsplus.srowen.com/ss?c=" + country + "&t=" + type + "&i=" + productID,
|
||||
HttpHelper.downloadViaHttp("https://bsplus.srowen.com/ss?c=" + theCountry + "&t=" + type + "&i=" + productID,
|
||||
HttpHelper.ContentType.XML);
|
||||
|
||||
String detailPageURL = null;
|
||||
|
@ -136,7 +144,7 @@ final class AmazonInfoRetriever extends SupplementalInfoRetriever {
|
|||
maybeAddText(formattedUsedPrice, newTexts);
|
||||
}
|
||||
|
||||
append(productID, "Amazon", newTexts.toArray(new String[newTexts.size()]), detailPageURL);
|
||||
append(productID, "Amazon " + theCountry, newTexts.toArray(new String[newTexts.size()]), detailPageURL);
|
||||
}
|
||||
|
||||
private static void assertTextNext(XmlPullParser xpp) throws XmlPullParserException, IOException {
|
||||
|
|
Loading…
Reference in a new issue