The integration with a JSON file has significant disadvantages and therefore is not recommended:
A recipe might be represented in JSON with additional meta information so that Bring! is able to import all ingredients. The value RECIPE_URL from the attribute data-bring-import="RECIPE_URL"
should therefore point to a JSON File.
Here is a sample JSON recipe:
{
"author": "Author Name",
"linkOutUrl": "https://www.myrecipe.com",
"imageUrl": "https://www.myrecipe.com/recipeImage.jpg",
"name": "Hummus mit Rüebli",
"tagline": "",
"yield": "",
"time": "",
"nutrition": {
"calories": "500 kcal"
},
"items": [{
"itemId": "Karotten",
"spec": "2-3"
}, {
"itemId": "Sumach",
"spec": "1/4 TL",
"altIcon": "Rosmarin",
"altSection": "Früchte & Gemüse"
}, {
"itemId": "Salz",
"stock": true
}]
}
<script async="async" src="//platform.getbring.com/widgets/import.js"></script>
<div data-bring-import="RECIPE_URL" data-bring-import-version="1" style="display:none">
<a href="https://www.getbring.com">Bring! Einkaufsliste App für iPhone und Android</a>
</div>
Make sure you link the JSON File via https.
If you host the JSON File on your own server, you need to configure CORS so that scripts from platform.getbring.com can access you JSON File.
Here is a sample .htaccess:
<IfModule mod_headers.c>
SetEnvIf Origin ^(https?://.+\.getbring\.com(?::\d{1,5})?)$ CORS_ALLOW_ORIGIN=$1
Header append Access-Control-Allow-Origin %{CORS_ALLOW_ORIGIN}e env=CORS_ALLOW_ORIGIN
Header merge Vary "Origin"
</IfModule>