49714 Programming for Online Prototypes
· 9 members
A hands on introduction to building online products and services through code
The intention behind this TotoBot was to share a little bit of personal information about me as a human, in a way that I would typically speak - with a lot of jokes, emojis, and gifs.
As we get older, it becomes increasingly difficult to establish a close relationship with another person. Compared to my youth, now I tend only to share surface level information about me when I meet a new person, capsulated by all that 'professionalism' and 'adultness.'
We are living in a world where most of the social interaction happens through the digital means; via the video calls, emails, and text messages. What if there is a bot that can help introduce myself before I meet someone in person so that our first real-life interaction becomes smoother and joyful?
I started this project by thinking about my own personality; how do I speak, which information I would typically share myself, and which information I would conceal but feel more comfortable to share if someone else can speak for me.
After sorting out the content, I started to brainstorm the personality of this TotoBot. I wanted this TotoBot to reflect my personality, so the people interact with it can get insights into who I am as a person, not only by the information but also by the way it behaves.
I originally had a grand plan to incorporate my personal Instagram account to share some pictures taken by me, and the Google Translate API to explain how I usually form a speech in real life (I think in Korean first then translate into English). However, I soon faced multiple roadblocks in authentication and pricing issues and realized I need to scope it down to something that's simpler but delivers the essence of myself - my personality along with some hidden facts about me. From then on, I started to generate a list of jokes I would make, fun facts about me, types of emoji I typically use, and possible conversation flow in the context of introduction. I decided to incorporate GIPHY API to generate gif-based answers to the non-precoded questions because this is how I usually talk to someone else.
Toto Bot is my personal concierge who reveals information about me. Basic questions like what, who, when, why, where returns simple information about the bot and myself. You can also ask what I like or hate, my favorite place or food to get to know little more about me. I wanted the TotoBot to respond to natural conversation, so I made it identify keywords in the questions using the below codes. So any sentence with the keyword would spit out the response I want. All the other questions return answers in random gifs to portray how I would usually text in real life.
Click to Expand
if body.include? "hi" message = greetings.sample + "I'm ToTo 🐰. I reveal some 'fact' about Suzanne 🌷 or 'joke' with you all day 😂 or find you some interesting gifs 👀" elsif body.include? "who" message = "I am ToTo 🐰, Suzanne's personal concierge 🙇. Suzanne is a 2nd-yr MDES student at Carnegie Mellon University. You can reply 'fact' to learn more about Suzanne!" elsif body.include? "where" message = "I live somewhere in the Cloud ☁️, but Suzanne lives in Pittsburgh 🌎, a old and rusty town in Pennsylvania." elsif body.include? "when" message = "I was created in Fall 2018 during Programming for Online Prototyping class 🖥! Suzanne was born on July 13, 1990 🎂." elsif body.include? "why" message = "I was made to reveal some 'fact' about Suzanne 🤹🏻♀️. I can also 'joke' with you or find you 'gifs' all day, all year." elsif body.include? "favorite food" message = "Suzanne's favorite food is sushi 🍣. She also like wine 🍷 and sake 🍶." elsif body.include? "likes" message = "Suzanne likes flowers 🌹, especially white roses. She also likes shiny little things 💎." elsif body.include? "hates" message = "Suzanne hates pizza 🍕. Oh, she hates nature too ⛰️. Yes, she really does." elsif body.include? "place" message = "Suzanne's favorite place is Paris, France ⛲. Next is Kyoto, Japan ⛩️!" elsif body.include? "rombi" message = "Rombi is Suzanne's one and only precious puppy 🐶. Rombi little poodle who is 3 years old 🐾." elsif body.include? "what" "You can ask simple questions like 'what', 'who', 'when', 'where', and 'why' to get to know more about me or Suzanne. I can also 'joke' with you or tell you 'fact' about Suzanne 🌷. If you'd like to see some gifs, just tell me anything-you will be surprised what I can find for you 🤹🏻♀️." elsif body.include? "joke" array_of_lines = IO.readlines("jokes.txt") message = array_of_lines.sample + laugh.sample elsif body.include? "fact" array_of_lines = IO.readlines("facts.txt") message = array_of_lines.sample else results = Giphy.search( body ) unless results.empty? gif = results.sample.fixed_width_downsampled_image.url.to_s message = "I chose this gif for your search! Hope you like it 🐰. Powered by Giphy.com." end end
Overall, it was a fun little project that introduced me to the concept of ZeroUI and programming. It was my first time coding so I expected a huge learning curve- and as I expected, it was a bit more complex than I thought. If I were to do it again, I would like to figure out a way to incorporate more advanced APIs to make the function more robust and dynamic.