grocy-android icon indicating copy to clipboard operation
grocy-android copied to clipboard

Support for custom product info api provider

Open cniry opened this issue 1 year ago • 1 comments

OpenFoodFacts is a big site, but in my case, it returns dozens product names in random languages and in many cases OpenFoodFacts doesn't know my products.

I would like to create a tiny proxy api script, which will parse product info by EAN on my favorite online grocery shop and provide json response.

Would you be so kind as to add another classes like OpenFoodFactsApi and OpenFoodFactsProduct, but with GUI configurable url? https://github.com/patzly/grocy-android/blob/23986e5cd1da8f721374702fc6df9f809818b190/app/src/main/java/xyz/zedler/patrick/grocy/api/OpenFoodFactsApi.java#L36

cniry avatar Apr 18 '23 20:04 cniry

If I can add a suggestion it would be to make possible to get the data from multiple url.

Since you can have world.openfoodfacts fr.openfoodfacts etc. etc. it would be usefull to add multiple providers and when you scan the ean code in the list you get "suggestions" with the "from" attribute so you know from which provider you got it.

It's the same api, just the url is different but it would require probably to implement a dynamic url (like @cniry said) and a different view list.

If I have time end of july I'll take a look if I can implement something (even if it's not merged, it would be useful at least for me :))

patrick-mota avatar Jul 14 '23 08:07 patrick-mota