<<

NAME

ProductOpener::MainCountries - determine the main countries a product is sold in

SYNOPSIS

DESCRIPTION

Products on Open Food Facts have a countries_tags field that list the countries where a product is sold. The information is entered by users, food producers, and additional countries are added by the scanbot.pl script if a product is scanned by 5 or more different IP addresses in a specific country.

In some cases, products may be marked as sold in a country even it is not widely sold in that country. For instance, a lot of discount shops import products that are intended for sale to other countries. Scan data can be tricky as well: people who live close to a border often shop in another country, and they may scan products when they are back in their home country.

This module tries to determine which countries a product is "mostly" sold in.

The determination is currently made on different factors: - scan data - languages

FUNCTIONS

load_scans_data()

Loads scans data aggregated by country from the products/all_products_scans.json file generated by scanbot.pl

compute_main_countries ( $product_ref )

Arguments

Product reference $product_ref

Return values

<<