Cli gem project you don't scare me... ok, maybe a little!

Posted by gnappo1 on May 3, 2017

I would lie saying that it’s been an easy and fun time the one spent on this project. First of all, as I guess happened to many of you, it took me literally two days to decide WHAT TO DO.

Atavic doubts were clouding my mind:

  1. “What would you like your user to experience?
  2. “What are you really able to do?
  3. “Would would most impress your mama and make her proud, so that she doesn’t complain about how much she’s spending for you?

I gotta admit the last one was the toughest, you know how drama queens Italians might be at times!

Anyways, I finally have my idea: why not building something useful that you might even use in your everyday life?! Isn’t it the whole purpose of coding?! Some of you might be thinking that I came up with a super cool idea that’s gonna make our lives way easier… Don’t be silly, I simply scraped my favourite Italian website of recipes… Desserts to be precise!

I know, disappoiting, but I actually like the idea of using my gem on a regular base and this is also the reason why I scraped all the info in my native language… Even more disappointed that you can’t even understand?! You’re right, but my family would have looked at it pretending to really read it and then kept talking about other things so… Italian it is!

More than digging into what I coded and why I did it ( which you can always ask me on whatever platform you prefer), I’d like to briefly show you guys how it works my grandma_sweets_cli_app! First, it greets the user with three sentences… notice anything? Yeah, of course I used the colors of our flag! hehe

After four seconds it displays the list of recipes with a name and a one-line description, so that you can cruise around and pick the one that gets you hungrier! hehe

Then you have what I called a ‘meditation pause”, so take your time and read. When you’re ready to go on press ‘c’… Did you type the wrong input a million times? Don’t worry, my program is veeeery patient and will wait for you to get it right… finally!

At this point, you’re gonna be asked to type the number of the recipe you’d like to know more about, ‘back’ to list the recipes again or ‘exit’ to leave. It’s expecting an input within the size of my recipe array, ‘back’ or ‘exit’, so whatever wrong input you give it will wait for you to get it right, as always. Once you type the number… voilà, here’s your recipe!

You’ll be asked if you’d like to open the recipe in a browser page:

You’ll be be asked if you want to save the recipe in your Favourite List and show the list or not. If the recipe already exists in the list and you type yes because you forgot, you won’t create a double anyway!

You’ll be asked if you’d like to see more recipes and go back to the list again or to type ‘n’ to exit.

Once you type ‘n’, you’ll see the goodbye message:

and maaaaaybe… really try the recipe! lol