Git Product home page Git Product logo

Comments (8)

RyanNoelk avatar RyanNoelk commented on August 20, 2024

I have mixed thoughts about importing data from other sites. I tried to do something similar awhile back but it never really worked the way I wanted it to. Long story short I don't want to include a "Import from URL" feature in the way that you are describing. Trying to support different parsers becomes messy really quickly and everyone has a different Idea on what a json dump of a recipe should look like. To counter this, I tried to make creating recipes super easier and a lot of the time I just copy paste text from the food blogs.

In light of that I do what to have some type of Import/Export feature (#15). I'm not entirely sure what that should look like ATM. But I don't wanna add a UI to it (except for maybe a link for users who are logged-in). Maybe something like a new API endpoint that takes a properly formatted json object with all the data needed inside. This would either replace or inherit the way that creating recipes is done now. We can also make it an array for bulk creation.

If you wanna build out a separate service that mines data from sites and provide a properly formatted json object (In your case, you can just use ruby to build the service). Then I will try and help guide you though what is needed and make a few changes to support this.

from openeats.

thomaspreece avatar thomaspreece commented on August 20, 2024

The reason I wanted it on the "Create Recipe" screen is because my idea was that clicking on the button would populate the fields for the user to correct/fill in manually with cut/paste. I'm quite happy to just create a separate service which I'll just run on a different endpoint. However I'll want it to direct to the Create Recipe page rather then just submitting it to the database. I see two ways of doing this atm:

  1. Separate service takes url, parses it and submits it to the import API. It then redirects to the Edit Recipe page for final corrections.
  2. Separate service takes url, parses it and redirects user to Create Recipe along with POST/GET data which the page accepts and fills in the fields.

From my point of view, 2 will be easiest for me to implement as I won't have to worry about user tokens/getting username for submitting of data to API. Also commiting dodgy data to the database and then correcting it afterwards in 1 seems wrong to me. What's your thoughts? Is there a option 3?

from openeats.

RyanNoelk avatar RyanNoelk commented on August 20, 2024

So I was thinking something a bit more abstract than that. I can see the advantage of using the form to fix/add information that may still be needed. But I'm not sure about building the specific recipe import feature into the code.

I was thinking of having whatever you (or any user) want to pull recipe data from as a separate script. Then add a textbox that allows the user to input a json blob, in the format of a recipe json that is returned by the API. From there the form can load the data just like as if it where editing something.

from openeats.

rustymyers avatar rustymyers commented on August 20, 2024

I've been using the API for a while to import and export recipes. I would think a chrome extension that allows specific sites to be captured and sent through the API to import would work. My current code is a bit old and I don't know if it still works with the recent changes to the recipe format, but it's pretty simple to create an json object from old xml data and send it to the site for import. Scraping a site is basically the same thing. Willing to share my python, but don't know much about extensions.

from openeats.

RyanNoelk avatar RyanNoelk commented on August 20, 2024

A chrome extension sounds like a pretty perfect solution!

from openeats.

thomaspreece avatar thomaspreece commented on August 20, 2024

An extension seems like a faff for such a simple import function. If the extension route is taken then it needs to be compatable with other browsers, thats the whole point of open eats being a web app so that it works on all platforms in my opinion.
The route I am currently favouring is a javascript bookmarklet which imports the page you are currently viewing, should be easier to implement then browser extensions.
I'm also still favouring a backend parser as it'll mean I don't have to rewrite existing code into javascript.

from openeats.

RyanNoelk avatar RyanNoelk commented on August 20, 2024

I still don't mind supporting a small button on the top of the recipe creation page. It would redirect the user to an import page which is just a textarea that accepts a json object. From there, the data will be sent to the recipe creation page (just like editing would). This way u can use any language and any parser you like.

from openeats.

RyanNoelk avatar RyanNoelk commented on August 20, 2024

Closing this as I don't have plans to support this feature any time soon. I would much prefer making the recipe creation better and faster to use. However PRs are welcome on the items discussed above.

from openeats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.