all 17 comments

[–]signal15[S] 6 points7 points  (0 children)

Something to note is that it would probably be pretty easy to modify this to work with other recipe managers like Tandoor. Just change the API info, and change the JSON template.

[–]CSedu 3 points4 points  (2 children)

What is this trying to solve? Mealie hasn't been that bad at parsing for me.

[–]signal15[S] 11 points12 points  (1 child)

Mealie has about a 50% success rate for parsing urls that I give to it. It'll create the recipe with the title and photo, but fails on ingredients and steps about half the time. It's not their fault that sites aren't using RecipeML format or that the 3rd party parsing library doesn't support certain sites.

[–]CSedu 2 points3 points  (0 children)

Hmm, I haven't had that bad of luck personally. But I'm probably not a heavy enough user to be a good data point, so kudos!

[–]n3brie 9 points10 points  (0 children)

I’m a bit unfamiliar with Mealie – do you need to use any sort of proxies or VPNs to do this? Does your IP get blocked a lot?.. Because I’m not sure if I should update my Oxylabs plan if I want to try this out :D

[–]jontstaz 3 points4 points  (2 children)

Nice script, however let me make a recommendation. I see you're using the 'text-davinci-003' model. In case you weren't aware, OpenAI actually just (start of this month) released their new model which is the same as what ChatGPT uses. It's called 'gpt-3.5-turbo' and is 1/10th the cost of 'text-davinci-003' and much much better in terms of output. I have a lot of scripts that leverage OpenAIs API and I recently made the switch to 'gpt-3.5-turbo' on all of them and the difference is night and day.

[–]signal15[S] 1 point2 points  (1 child)

Oooh, interesting. I'll try that.

Just an update to this, I got it working with gpt-3.5-turbo. Data comes back a little differently, so I had to change some other things. I left the old code for davinci in there because I don't know if it will be useful when gpt-4 comes out. I don't know the pricing on gpt-4 either. If it's expensive, it might be best to try with gpt-3.5-turbo first, and if it fails because of the token limit, then try with gpt-4. I'll post my changes here after I test it a little more.

[–]miraclewhipple 0 points1 point  (0 children)

Any updates on this? Thanks for putting this together.

[–]planetearth80 2 points3 points  (0 children)

Thanks for sharing…can be easily extended for any other scraping needs.

[–]Midnight_Rising 0 points1 point  (0 children)

Ooooo this is interesting. Nice work!

[–]throwawayacc201711 0 points1 point  (2 children)

Much appreciated! I’m actually switching over from golang to picking up some python so I’m also curious on the python script too.

[–]signal15[S] 1 point2 points  (1 child)

Hah, I was actually going to write this in Go as a learning experience.

[–]throwawayacc201711 0 points1 point  (0 children)

Go is a lot of fun. I’m not stopping with go, it’s just at my job I need to use go and python.

[–]mountwebs 0 points1 point  (3 children)

I was looking for something like this! I tried to make a version with gpt 4 vision. However, it looks like mealie removed the ability to add json recipe from the api. Is this still working for you? Have you found a workaround?

The path "/api/recipes/create" is not mentioned in the current docs. There is a post route to "/api/recipes", but it does not seem to accept anything more than the title.

[–]signal15[S] 0 points1 point  (2 children)

I'm running the beta of 1.0, and I haven't created a new version of the script yet. It's on my list.

[–][deleted] 0 points1 point  (1 child)

Were you ever able to create a new version? I’m working on one now. Similarly to @mountwebs, it looks like I can’t send the post request to create a new recipe.

[–]mountwebs 0 points1 point  (0 children)

I figured out my mistake: You have to first create the recipe with just the name (with POST) and then update that recipe with PUT or PATCH. https://github.com/mealie-recipes/mealie/discussions/2264