Jump to Navigation

Script to get AnyMeal Recipes quickly

Well over the festive season I have been in Durban visiting family, relaxing and recharging for 2009. For those readers not in South Africa, Durban is situated on the east cost and has a warm, humid sub-tropical climate. Unfortunately the weather has been overcast most of trhe time. Can you say "global warming"?

One of my annual tasks is to upgrade my folks machines to the latest Ubuntu release and see if I can find any programmes that can help them with their day to day routine. Since they are retired one of the main things they do now is cook. Not just any dishes but new and exciting ones. (I will need to go to gym again after this visit.)

I looked for some good cooking and recipe sites but since this is not a interest of mine I am not sure if I found the right ones for them. In any event here are the best I could find.

I also looked through Ubuntu's application repository and found AnyMeal an application front-end to a database for recipes. Installing the application was the easiest part I then search for some recipes to import. The application web site  gives some links to files to import. This could be a painful process as the main site for recipes has 100's of files to download and then import into the application individually. Since it is the holidays and I don't want to do this manually I wrote a quick script to download and unzip the files. I have added it below for anyone who wants to use it. You still have to import via the application but you can select all files at once to import, so its not to bad.

 #!/bin/sh
wget http://thehoseys.com/recipes.html
files=`sed -n  's/^<P><A href="\(mm[0-9]*\.zip\)">.*/\1/'p recipes.html`
for file in $files; do
        wget http://thehoseys.com/$file
        unzip $file && rm $file;
done

In general I think the programme anymeal can do with a much needed UI make over. I think my folks may find it difficult to use without me showing them how to use it. Then again my Mom is quiet keen to learn so I am sure she will get the hang of it after a few goes. Have a great new year! 

Open Source: 

Comments

Instead of importing dozens of 500-recipe files, concatenate those little fellows...
cat *.* >> large

I think the AnyMeal programme is crude but very easy to install. Now we should generate a PHP script to do the searching and displaying from the LAN via web browsers. Then the clunky user interface need only annoy the system admin and the ordinary readonly users have a smoother experience.



by Dr. Radut.