Comments (8)
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.
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:
- Separate service takes url, parses it and submits it to the import API. It then redirects to the Edit Recipe page for final corrections.
- 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.
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.
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.
A chrome extension sounds like a pretty perfect solution!
from openeats.
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.
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.
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)
- Proper Fractions Throw 500 Error HOT 1
- Error on RPi4: Cannot start openeats web, api and nginx HOT 20
- When using remote DB openeats manage.py fails with pretty much everything due to not using Password... HOT 1
- Web container keeps stopping with error code 0 (portainer) HOT 2
- Access Denied - I think to DB HOT 2
- Support wake lock on recipe page to prevent device from sleeping
- Website blank on fresh install HOT 2
- Recipes with content cannot be created
- New Install - Database not populated and API not communicating? HOT 11
- Images of pictures not showing, due to the port not being put in the image url HOT 2
- Create sections of ingredients for multi-part recipes HOT 5
- Setup with external db not working (Composer errors) HOT 18
- Use name rather than username if it exists
- Images Broken When Accessing Via Internet HOT 2
- Open-eats.github.io site blank. HOT 6
- Found a possible security concern HOT 6
- no matching manifest for linux/arm64/v8 in the manifest list entries HOT 3
- API doesn't seem to work HOT 2
- pls update quick-start.py HOT 2
- pls update quick-start.py HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openeats.