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|“/incomingSms”, async (req: Request<any, any, SmsBody>,
     res: Response) => { 
113|       const { from, to, text } = req.body
115|       const randomQuote = await generateQuote(text)
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|  })

SMS Application Flow Chart

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:

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:

Voice Application with Transcription

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|“/incomingCall”, (req: Request, res:
     Response<freeClimbSdk.PerCL.Command[]>) => { 
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(
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.”

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.

Look for challenge #3 soon!