# 2024-03-02 - JSON-LD to MealMaster
Someone sent me a link to a blog post about MOAR [1], a gopher
accessible recipe search that i worked on. Part of this post caught
my attention:
> While I was reading I discovered that a lot of modern recipe
> websites include some structured data in the document head in the
> form of JSON-LD (which is JSON with Linked Data). And consequently,
> a lot of modern recipe software can import recipes directly from
> the web if you provide it with a URL for a document that has that
> kind of data.
Challenge accepted! I resolved to create a semi-automated process to
import recipes from the web into Meal-Master.
First, the toolset is described below [13].
I unzipped all of the tools and made sure they were in my path.
Select a recipe to import: Tofu Peanut Stir-Fry [2]
Download the document:
C:\>lynx -source https://www.bbc.co.uk/food/recipes/
tofu_peanut_stir-fry_62729 >stirfry.htm
Convert to stirfry.txt:
C:\>gawk -f jsontomm.awk stirfry.htm stirfry
This process is SEMI-automated. Correct stirfry.txt as desired.
Convert to stirfry.mmf
C:\>mm_bustr
MealMaster Buster Version 2.0n
Press <CONTROL-BREAK> to abort this program!
Volume in drive C is FREEDOS2022
Volume Serial Number is 6969-6969
File not found.
Enter filename to convert: stirfry.txt
Enter any line you want to appear in each recipe below.
(such as where the recipes were found, etc.)
(Hit <RETURN> to leave blank and include no posting info)
Recipe FROM: https://www.bbc.co.uk/food/recipes/
tofu_peanut_stir-fry_62729
Converted Recipe: Tofu Peanut Vegan Stir-Fry
Unformatted Recipes Converted
Total of 1 MealMaster Recipes in file STIRFRY.MMF
Press <RETURN> to continue (or <CONTROL-X> to end program)
At this point, press Ctrl-X or else Meal-Master Buster will delete
stirfry.mmf, yanking the tablecloth out from under you.
MealMaster Recipe Buster [Version 2.0n] (c) 1996-99, Glen G. Hosey
Report any problems/suggestions to hosey@erols.com
Load the resulting MMF file into Meal-Master:
mm
Press any key to dismiss the splash screen [3] and enter the
Main Menu [4].
Press U to enter Utilities Menu [5].
Press I to open Import Recipe Screen [6].
Enter filename and press return, or filepath and F1 for list
Last File Imported: RECIPE6.MMF
Import From File:
Type STIRFRY.MMF and press Enter to open Recipe Import Menu.
Press S to begin importing recipe.
The Import Recipe Screen [7] reports that 1 recipe was found and
imported.
Press any key to dismiss Import Recipe Screen and return to the
Utilities Menu.
Press X to return to the Main Menu
Press S to open the Search Menu [8]
Press T to search by Title
Type: Tofu Peanut Vegan
Press Enter
Press S to search with the specified critera.
Because there is only one result [9], it is selected by default.
Otherwise, one can use the arrow keys to select the desired
recipe.
Press E to export the selected recipe [10]
Press Enter 3 times to accept the defaults
Press Enter for the 4th time to export TRANSFER.TXT
Press X to return to the Search Menu
Press X to return to the Main Menu
Press Q to quit Meal-Master
Press Y to confirm that you wish to quit Meal-Master
The file TRANSFER.TXT [11] will be in Meal-Master v8.06 format.
This can be shared anywhere that accepts plain text messages,
and imported into any Meal-Master compatible recipe manager.
See also my post about how to pretty-print Meal-Master recipes to PDF
in DOS [12].
tags: bencollver,retrocomputing,technical
# Footnotes
(HTM) [1] Supervegan blog post
(HTM) [2] Tofu Peanut Stir-Fry
(IMG) [3] Meal-Master Splash Screen screenshot
(IMG) [4] Meal-Master Main Menu screenshot
(IMG) [5] Meal-Master Utilities Menu screenshot
(IMG) [6] Meal-Master Recipe Import Menu screenshot
(IMG) [7] Meal-Master Import Recipe Screen screenshot
(IMG) [8] Meal-Master Search Menu screenshot
(IMG) [9] Meal-Master Search Results Screen screenshot
(IMG) [10] Meal-Master Recipe Export Screen screenshot
(TXT) [11] TRANSFER.TXT (example export file)
(DIR) [12] Print Quest Part 2
[13] Toolset to import JSON-LD recipes into Meal-Master
(HTM) Gawk (DJGPP) (32-bit)
(DIR) json2tsv (16-bit)
(TXT) jsontomm.awk
(HTM) Lynx (FreeDOS) (32-bit)
(BIN) Meal-Master
(BIN) Meal-Master Buster
# Tags
(DIR) bencollver
(DIR) retrocomputing
(DIR) technical