OCR/Script

From Open Food Facts wiki
Revision as of 15:39, 5 November 2016 by Teolemon (talk | contribs) (Created page with "<pre> # Get all the products that are ingredients complete AND have selected images # Loop through products wget -O - -q -t 1 http://fr.openfoodfacts.org/api/v0/produit/2039...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


# Get all the products that are ingredients complete AND have selected images
# Loop through products
wget -O - -q -t 1 http://fr.openfoodfacts.org/api/v0/produit/20396145.json | jq '.product.states_hierarchy'
string='My long string';
if [[ $string == *"en:photos-validated"* ]] and if [[ $string == *"en:ingredients-completed"* ]] then
  echo "It's there!";fi

if "en:photos-validated" and "en:ingredients-completed" in output:
wget -O - -q -t 1 http://fr.openfoodfacts.org/api/v0/produit/20396145.json | jq '.product.ingredients_text'
wget -O - -q -t 1 http://fr.openfoodfacts.org/api/v0/produit/20396145.json | jq '.product.image_url' 
wget -O - -q -t 1 http://fr.openfoodfacts.org/api/v0/produit/20396145.json | jq '.product.image_url' | tesseract  outputocrfull.txt -l fra -psm 3
tesseract ingredients.19.full.jpg outputocrfull.txt -l fra -psm 3
diff file1.txt file2.txt