Contact Us

570 Lake Cook Road

Suite 400

Deerfield, IL 60015

2 North Riverside Plaza

Suite 225

Chicago, IL 60606

info@freeclimb.com

support@freeclimb.com

partners@freeclimb.com

media@freeclimb.com

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Talk to an Expert

570 Lake Cook Road

Suite 400

Deerfield, IL 60015

2 North Riverside Plaza

Suite 225

Chicago, IL 60606

info@freeclimb.com

support@freeclimb.com

partners@freeclimb.com

media@freeclimb.com

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Resources  ▶︎  
Knowledge Center
Article

FreeClimb API Challenge #2: Build a movie quote app for voice or SMS

February 13, 2024

Looking to test out your developer skills AND impress film fanatics? Follow along to create an app that generates a popular movie quote from a word or phrase using SMS or voice.

Second in a series.

“Accept the challenges so that you can feel the exhilaration of victory.”
— Gen. George S. Patton

I’ve always enjoyed finding quotes to highlight a point I’m trying to make. I’m back with another challenge for developers like you, and I like General Patton’s thinking about challenges.

Know what else I love? Movies!

“You can map your life through your favorite movies, and no two people’s maps will be the same.”
— Mary Schmich

Bring on the challenges!

The object of this challenge is to create an app that delivers a quote from a popular movie in response to a short prompt.

For example:

  1. If the prompt is “panic,” the app might deliver “This is the perfect time to panic!” from Toy Story.
  2. Or if the prompt is “goodbye,” the app might deliver “I don’t ever say a final goodbye. I always just say, I’ll see you down the road,” from Nomadland.
  3. If a prompt returns multiple quotes, the app should return a random one.

The basic challenge is to build this app for SMS. The user sends a text with their word or phrase, and the app returns a quote matching it.

The advanced challenge is to build this app for voice response. The user speaks their word or phrase, and the app returns a quote matching it. The user gets five seconds to say their word or phrase. If they don’t say anything (or don’t speak clearly), the app says, “I didn’t hear your answer — could you please repeat it?”

Building your movie quote app with the FreeClimb API

“The code is more what you’d call guidelines than actual rules.”
— Pirates of the Caribbean: The Curse of the Black Pearl

I built my movie quote app using the FreeClimb API, and that’s the perfect place for you to start. Here are some more guidelines that may help you build your version:

  1. Use your free trial for the FreeClimb API.
  2. If you haven’t started your free trial, you can sign up for one here. (It’s free. 😀)
  3. You can use any tools from the FreeClimb API.
  4. You can use existing lists (I like QuoDB) or build your own if you have a deep love for a specific genre.

With the voice version, there will be a finite set of phrases that the application can recognize. The text version will be a little more flexible, as any phrase should be able to return a movie quote.

For the SMS version, here’s a good overview of how to send and receive messages using FreeClimb. We suggest you:

  1. Get the quote in the text message.
  2. Make an HTTP request to QuoDB and provide the quote. (Here’s one example.)
  3. QuoDB will respond with a list of movies that match the quote.
  4. Use FreeClimb to respond to the text message with a movie title that matched.

Here’s a peek at part of my app for SMS:


112|  app.post(“/incomingSms”, async (req: Request,
     res: Response) => { 
113|       const { from, to, text } = req.body
114|
115|       const randomQuote = await generateQuote(text)
116|
117|       if (randomQuote) {
118|          const { title, phrase, year } = randomQuote
119|          const movieTitle = `${title} ${year}`
120|          const movieQuote = `the quote is: “${phrase}”`
121|          await freeClimb.api.messages.create(to, from,`$
      {movieTitle} ${movieQuote}`)
122|          res.sendStatus(200)
123|      } else {
124|          await freeClimb.api.messages.create(to, from, “Something
      unexpected happened”) 
125|      }
126|  })

A diagram showing the major components of an SMS application using a movie quote back-end.

There are two ways to tackle the voice app. The first way is to transcribe the user’s voice input into text (via Google or another speech-to-text provider), then follow the same steps as for the SMS app, with the added step of converting the app’s response back to voice:

A diagram showing the major components of a voice application using transcription and a movie quote back-end.

The second way involves using a grammar like getSpeech in FreeClimb to interpret the user’s voice input and match it with a quote in the grammar list. The app then speaks the quote back to the user:

A diagram showing the major components of a voice application using grammar-based speech recognition  and a movie quote back-end.

For either approach to the voice app, you may find these links helpful:

Here’s a peek at part of my app for voice:


51|  app.post(“/incomingCall”, (req: Request, res:
     Response) => { 
52|      const actionUrl = `${HOST_URL}/movieQuote`
53|      const grammarFile = `${HOST_URL}/grammar`
54|      const options: freeClimbSdk.PerCL.GetSpeechOptions = {
55|          grammarType: “URL”,
56|          playBeep: true,
57|          grammarRule: “Movies”,
58|          prompts: [
59|              {
60|                  “Say”: {
61|                      “text”: “After the tone, please say
62|  something and I will give you a movie quote” 
63|                  },
64|              },
65|              {
66|                  “Pause”: {
67|                      “length”: 200
68|                  }
69|              }
70|          ]
71|       }
72|       const getSpeech = freeClimb.percl.getSpeech(actionUrl,
73|  grammarFile, options)
74|      res.send(freeClimb.percl.build(getSpeech))
75|  })

I hope you find this challenge, um, challenging, but I’m sure you’ll be able to pull it off, because FreeClimb was built by developers like you and me. We don’t just build applications for a living — we do it because we’re good at it, and it’s fun to create something really cool just because we can. All you need is a world-class development tool.

“When I was a kid, it seemed like they made something new every day. Some, gadget or idea, like every day was Christmas.”
Interstellar

Have questions about using FreeClimb? Want a little extra insight? Visit our Support page and explore to your mind’s content.

Ready to activate the full power of FreeClimb?

We built FreeClimb to give you something other APIs can’t — the power of the Vail platform. You can quickly and easily integrate Vail’s voice and SMS API technologies into your applications with the highest standards of security and stability in the industry.

Now that you’ve seen what you can do with FreeClimb, why not make it part of your everyday arsenal? Start building highly scalable, feature-rich communication solutions in-house with the flexibility and security of the Vail platform — upgrade your trial account today.

It’s the most powerful, flexible, affordable communications API you’ll ever use. And you can quote me on that.

Introduction

Mi tincidunt elit, id quisque ligula ac diam, amet. Vel etiam suspendisse morbi eleifend faucibus eget vestibulum felis. Dictum quis montes, sit sit. Tellus aliquam enim urna, etiam. Mauris posuere vulputate arcu amet, vitae nisi, tellus tincidunt. At feugiat sapien varius id.

Eget quis mi enim, leo lacinia pharetra, semper. Eget in volutpat mollis at volutpat lectus velit, sed auctor. Porttitor fames arcu quis fusce augue enim. Quis at habitant diam at. Suscipit tristique risus, at donec. In turpis vel et quam imperdiet. Ipsum molestie aliquet sodales id est ac volutpat.

Image caption goes here
Dolor enim eu tortor urna sed duis nulla. Aliquam vestibulum, nulla odio nisl vitae. In aliquet pellentesque aenean hac vestibulum turpis mi bibendum diam. Tempor integer aliquam in vitae malesuada fringilla.

Elit nisi in eleifend sed nisi. Pulvinar at orci, proin imperdiet commodo consectetur convallis risus. Sed condimentum enim dignissim adipiscing faucibus consequat, urna. Viverra purus et erat auctor aliquam. Risus, volutpat vulputate posuere purus sit congue convallis aliquet. Arcu id augue ut feugiat donec porttitor neque. Mauris, neque ultricies eu vestibulum, bibendum quam lorem id. Dolor lacus, eget nunc lectus in tellus, pharetra, porttitor.

"Ipsum sit mattis nulla quam nulla. Gravida id gravida ac enim mauris id. Non pellentesque congue eget consectetur turpis. Sapien, dictum molestie sem tempor. Diam elit, orci, tincidunt aenean tempus."

Tristique odio senectus nam posuere ornare leo metus, ultricies. Blandit duis ultricies vulputate morbi feugiat cras placerat elit. Aliquam tellus lorem sed ac. Montes, sed mattis pellentesque suscipit accumsan. Cursus viverra aenean magna risus elementum faucibus molestie pellentesque. Arcu ultricies sed mauris vestibulum.

Conclusion

Morbi sed imperdiet in ipsum, adipiscing elit dui lectus. Tellus id scelerisque est ultricies ultricies. Duis est sit sed leo nisl, blandit elit sagittis. Quisque tristique consequat quam sed. Nisl at scelerisque amet nulla purus habitasse.

Nunc sed faucibus bibendum feugiat sed interdum. Ipsum egestas condimentum mi massa. In tincidunt pharetra consectetur sed duis facilisis metus. Etiam egestas in nec sed et. Quis lobortis at sit dictum eget nibh tortor commodo cursus.

Odio felis sagittis, morbi feugiat tortor vitae feugiat fusce aliquet. Nam elementum urna nisi aliquet erat dolor enim. Ornare id morbi eget ipsum. Aliquam senectus neque ut id eget consectetur dictum. Donec posuere pharetra odio consequat scelerisque et, nunc tortor.
Nulla adipiscing erat a erat. Condimentum lorem posuere gravida enim posuere cursus diam.

Elevate Your Conversations
Every year leading consumer brands trust our cloud services to make billions of customer conversations better. Find out how we can help your company realize your customer care communications goals.