Building a SMS App in the Cloud

I've written several Twitter bots, including WiiMe and Amazon Book Finder and have experimented with various ways of coding/running bots like that. With that in mind, after reading WebMonkey's Build an SMS Notification App I decided to build the same app that my amazon twitter app does, but this time powered by TextMarks and App Engine.

14 minutes later you can send 41411: isbn 0596517742 and it will SMS you the prices at Amazon.com within a minute. (half of the 14 minutes was figuring out how to parse XML using python on App Engine)

It took almost no code to interface Amazon on bookburro.org's appengine. (please forgive my hackish python as I spend most of my time in ruby)

class isbn:
    def GET(self, isbn):
        url = "http://webservices.amazon.com/onca/xml" + \
              "?Service=AWSECommerceService&AWSAccessKeyId=%s" + \
              "&Operation=ItemLookup&ResponseGroup=Medium&ItemId=%s"

        result = urlfetch.fetch(url=(url % (amazon_aws_access_key, isbn)), 
                                method = urlfetch.GET)

        prices = []
    
        if result.status_code == 200:
            dom = minidom.parseString(result.content)
            for node in dom.getElementsByTagName('FormattedPrice'):
                prices.append(node.firstChild.data)

            if len(prices) > 0:
                return "Amazon.com prices: %s" % ', '.join(prices)

        return "send an ISBN to find Amazon.com book prices"

Google, Amazon, and TextMark (and web.py) have made building an SMS app trivial and fun. Also the user experience is much nicer than with Twitter. Users of my twitter bots have to: 1) follow the bot, 2) private messages d amazon [ISNB].


Responses to "Building a SMS App in the Cloud"

  1. Thu, 18 Sep 2008 Robby Russell says:
    One minor thing... is that the ISBN # ends up getting rendered as a potential phone number. Not a big fan of that as it's not and I could accidentally hit it...thus attempt to call a wrong # and annoy me. ;-)

    What about: ISBN #3786513950 ?

    Wonder if the # would prevent the iPhone from rendering it as a call link.

    Just a thought and my two cents.

Leave a response

Published

Wed, 17 Sep 2008

Tags

amazon aws book burro appengine

Comments

1 comments
add yours

Feed

subscribe to my newsfeed

© 2005-2008, Jesse Andrews; licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.