Twilio + Google App Engine
Time to read: 3 minutes
Price It by Phone makes it easy to check Amazon.com for the lowest
prices on books while you're out shopping at the store. Call 877-265-8137 and enter the 10 digit ISBN code to find the new and used prices are on Amazon. Then visit the Price It by Phone website and enter your phone number for a full list of books you've searched.
Introducing Price It By Phone
Price It By Phone lets you comparison-shop for books with your touch-tone phone.
Look
up Amazon.com book prices by calling (877) 265-8137. Enter the book's
10-digit ISBN number after the prompt. The voice will tell you
Amazon.com's lowest new and used prices for the book.
Then, to
see the list of books that you've already price-checked, with links to
their Amazon detail pages, enter your phone number at http://price-it.appspot.com.
"I
hacked this together from scratch this weekend. It's fully functional
as of now, but I still hope to make some bugfixes and maybe add some
important features before the deadline (e.g. proving that you own the
phone number after you enter it in the web form). Please let me know
if you run into any problems!"
Audrey Speaks on Developing with App Engine and Twilio
We had a chance to interview Audrey about her experience building Price It, and here's what she had to say:
How did you hear about Twilio?
I first heard about Twilio at SF Startup Weekend (April 09). I saw the MonkeyCalling phone survey hack and couldn't believe it was made in a weekend.
How did you come up with the idea for Price It by Phone?
I was at an art museum in Washington, DC on Saturday afternoon,
looking at books in the bookstore. There was a thick art book (check
out Audrey's art) that I
really wanted to buy, but I didn't want to carry around such a heavy
book while traveling, and I had already gone beyond my shopping
budget. I looked up Amazon.com on my phone to see if it was
available. It was there, and for $37 instead of $60.
I
based my app on Twilio's Weather By Phone App Engine sample. Price-It
sends a REST request to the Amazon Product Advertising API, passing it
the entered ISBN number. Amazon sends back the book data as XML.
Price-It extracts the book title and lowest new/used prices and outputs
a simplified XML response to the caller, using the Say verb so that the
result gets spoken. At this time, the ISBN also gets saved to the
datastore under the caller's phone number.
As for displaying the lookup history on the web: the HTML form
passes the phone number to Price-It via a get request, receiving a
JSON-formatted list of ISBNs in return. Then, the JavaScript side of
Price-It sends XMLHttpRequests to Amazon, one for each ISBN. The XML
response data gets parsed and formatted in JavaScript with the help of
jQuery. A side note: the background and header artwork is also drawn
with JavaScript, on an HTML5 canvas using Processing.js.
How long did it take to build Price It by Phone?
I
began this on Saturday mid-afternoon and finished on Sunday night. I
stayed up really late on Saturday night to get the bulk of the work
done. All the code was written from scratch, although being familiar
with App Engine and jQuery helped a lot. I didn't expect to finish in
time – I was surprised that it all came together.
What do you think of the development experience with Twilio on App Engine?
The
Twilio+App Engine part of this was easy. The nice thing about the
Twilio API is that there are so few pieces that it's hard to go wrong.
The Twilio side was about 25% of the work. Dealing with Amazon, XML,
polishing it all was the other 75%.
Perhaps having another sample showing a web form where you enter
your phone number, wait for the app to call you with a verification
code, and then enter that code on the web would have been helpful (or
having some kind of phone verification checking built into the Twilio
API). The Twilio forums were quite helpful.
Anything else you want to share?
Thanks to everyone at Twilio! I'll be working on v2 of Price-It – hopefully I'll have an update on this soon.
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.