Archive for the ‘Twitter’ Category

The Winners of the Portland OpenGov Hackathon are…

Monday, October 4th, 2010

Tropo and GeoLoqi would like to thank all of the participants in the yesterday’s 8 hour open government hackathon!  At 8:30 AM, approximately 25 code warriors converged on NedSpace, a Portland co-working space, for a full day of social hacking and a mission to change the world.  The goal was to find local government data available through either CivicApps.org, run by Rick Nixon and the city of Portland, or PDX API, run by  Max Ogden – master opengov hacker, and integrate it into an application that used either Tropo’s cloud communications API or GeoLoqi’s geo API (or both).

City officials, Rick Nixon and Skip Newberry, were on hand to inspire the teams and help judge the winners!  Judging was difficult because all of the applications were very impressive but but a couple stood out of the crowd based on idea, product features, and utilization of APIs.

Winner of the Tropo Sonos Media System:

Simon Walter-Hansen won Tropo’s Sonos media system prize for his creative use of our SMS and Voice API with his Heritage Tree Quest game!  Portland residents and visitors can interact with Heritage trees around the state using Tropo’s SMS or Voice with speech recognition.  As you locate tagged trees you can interact with them scoring points for each find and trivia question answered!

The participants dubbed this application PacMac for horticulturists!

Winner of the GeoLoqi iPad:

Reid Beels won GeoLoqi’s iPad prize for his creative use of geo location service API! “Don’t Eat That!” pulls health inspections from the county’s web page via screen scraping techniques. Using GeoLoqi’s mobile app, users receive SMS messages (via Tropo) to notify them of restaurants with scores under a certain threshold within 100 meters of their current location. SMS messages look like, “What ho! You might not want to eat at Backspace, their last inspection score was 93!” The rest is up to you whether you want to run away or sneak in for a closer look at the dirty restaurants near you! Don’t Eat That will also post links to the reports as tips on Foursquare!

Notable Runners Up:

Julie Baumler developed a cool Twitter application using Tropo’s Twitter API to engage people looking for pets to adopt through Multnomah County Animal Services database and petfinder.com.  Status updates are can be tweeted on the pet’s behalf or users can receive status updates with pets are available that match their search results.

A few of the folks from Cel.ly joined us notably Pierce and Daniel.  Their application, BarBird , tracks tweets coming from bar’s twitter accounts.  While the application wasn’t finished, they intend to push these messages to your cell phone via Tropo’s SMS API when you get within range of the bar using GeoLoqi’s geo location API.

We would like to thank everyone again especially Amber Case and Aaron Parecki of GeoLoqi for such a fun time and world changing experience!  We’ll leave you with a few other photos!  Be sure to catch our next event as they are a bunch of fun!

Scaling Your Twitter Support, Part 1: Adding a “Night Service” via Tropo.com

Friday, May 7th, 2010

What do you do if your use of Twitter for customer interaction is wildly successful? How do you scale your support for using Twitter for customer service, customer support or other topics? Do you hire a bunch of extra people? like Staples did? Or do you look at using tools and services to help your existing staff through automation and/or augmentation of the staff’s efforts?

If you have been reading previous posts about Tropo and Twitter or if you follow me on Twitter, you’ll know I’m a wee bit passionate about the service… and this particular question continues to intrigue me:

How do you scale your Twitter support?

Obviously you can hire a bunch of people to help with responding to tweets, like Staples and Comcast (which once upon a time had only Frank Eliason on Twitter but now has a whole crew). You can have them work different shifts or be in different parts of the world to help with coverage. You can do all that, if you can afford to do so.

But for many companies, that may not be an option… and so ever since we introduced support for developing Twitter applications in Tropo.com, I’ve been thinking about how you could use Tropo to automate and augment your Twitter support. In a couple of presentations about Unified Self-Service, I’ve mentioned having a couple of people who support Twitter interaction and asked the question:

What do you do when those employees go home for the evening?

Do you:

  1. Wait to respond to all Twitter inquiries until the next business morning?
  2. Require your staff to check every few hours to respond?
  3. Require your staff to work off hours to have 24×7 coverage?

Many companies probably treat Twitter messages like email or phone… “we’ll get back to you tomorrow”… but what if you want to provide a higher level of service? What if you want to help people by pointing them to your website?

A SOLUTION?

One solution that came to my mind was to resurrect the “night service” idea from the telephony days… create an automated agent attached to your Twitter account that only replies to Twitter messages during certain hours.

This turns out to be ridiculously simple in Tropo! Here’s a VERY basic implementation in python:

from datetime import *
answer()

if datetime.now().hour not in range(12,21) :
    say("Our offices are currently closed. We will reply to your tweet as soon as we can but in the meantime, please visit http://www.tropo.com")

hangup()

That’s it.

NOTE: Time on Tropo servers is in UTC/GMT, so you need to adjust offset accordingly. US Eastern Daylight Savings Time is +4 hours, so 5pm is 17:00 EDT = 21:00 UTC. My example code, therefore, does NOT respond between the hours of 8:00 am and 5:00 pm US Eastern time.

MAKING IT SMARTER

Now, this example is exceedingly dumb. It simply fires back a single tweet as an “@” response to any mention of the Twitter account. This is probably not what you want, given that it doesn’t differentiate between a “reply” to your Twitter account (where the “@username” is at the very beginning) and just a reference to your Twitter account in the body of a tweet.

So how do you tell the difference?

It turns out that there is a simple way (and yes, we need to document this better). If the Twitter message is a “reply” with your “@username” at the beginning of the tweet, your Twitter username is removed before the tweet text is sent to your app. If the Twitter message mentions your Twitter username, it is just included in the message text. The rationale here is that a reply is pretty much like an instant message or SMS … and so we are making it easy for your app to treat IM, SMS and Twitter replies in the same way. Regardless, the “currentCall.initialText” variable is loaded with the text that was sent to your account – your Twitter username is just stripped out if it is a reply message.

The end result is that you can determine if the message is a “reply” (or “public message”) to your twitter account by testing for the absence of your Twitter name.

Modifying the code above to respond to only messages versus mentions, it looks like this in Python:

from datetime import *
answer()

if datetime.now().hour not in range(12,21) :
    if currentCall.initialText.find("@stratohelp") == -1:
        say("Our offices are currently closed. We will reply to your tweet as soon as we can but in the meantime, please visit our web site at www.tropo.com")

hangup()

In this case, the python string function “find” returns a “-1″ if the string is not found. The Twitter username I’m showing here is “@stratohelp”, which you obviously need to replace with your own account name.

Now, again, I’m still sending out only a very basic message. I could start adding more functionality to this to make it smarter. Features like:

  • Scanning the “initialText” for keywords and responding back with specific URLs. For instance, pointing people to a FAQ entry for particular phrases.
  • Performing other actions based on keywords in the tweet, like sending email or a SMS to a certain person within your company.
  • Using the Twitter ID (found in currentCall.callerID) to personalize the message back, perhaps by doing a dip into a database to retrieve info.

There are many more actions you can take… and I’ll look at some of those in the next posts in this series.

TRYING IT OUT

To try this yourself, just:

  1. Login to your Tropo.com account (or sign up for a free developer account).
  2. Create a new application and set it to only respond during certain hours (remembering the UTC offset). If you copy/paste my code above, name the file ending in “.py”.
  3. Follow these steps to link a Twitter account to your Tropo app.
  4. Try out sending tweets to that Twitter account during both the time the app should respond and when it shouldn’t.

Note: When you are developing and testing an app, please do remember the restrictions on duplicate tweets… your app will not be able to keep sending the identical response to the identical Twitter account, so you may want to have multiple Twitter IDs for your testing.

Have fun with it… and please do let me know if you do anything cool with a Twitter app. I’d love to write about other fun uses here. Also, if you have examples similar to the code I’ve done above in languages other than python, please let me know as a comment here or as an email and I’d be glad to add them here as additional examples.

Tropo and the Upcoming Twitter API Change

Monday, May 3rd, 2010

Following up on IMIfied’s post on the upcoming Twitter API changes, Tropo will not be impacted since we only support OAuth for authentication with Twitter. Therefore when Twitter shuts off their HTTP Authentication at the end of May 2010, you do not have to change anything for your Tropo apps using Twitter.

Testing a Tropo app with Twitter? Remember that Twitter rejects duplicate tweets…

Friday, March 26th, 2010

Just a quick note… if you have decided to try building a Tropo app that interacts with Twitter, perhaps based on our blog posts about how to add Twitter to a Tropo app and how to make a Tropo app react differently per channel, you may want to be aware in your testing that Twitter rejects duplicate tweets sent in a quick time period. This Twitter Support ticket has the info:

http://help.twitter.com/forums/10713/entries/68809

I got bit by this yesterday testing the weather app I outlined in those blog posts. As I was modifying the code, I was tweeting out the same ZIP code to test the differences:

@danweathertest 32801
@danweathertest 32801
@danweathertest 32801

and didn’t understand why the subsequent tweets just… disappeared. I was using TweetDeck and it was only when I tried tweeting from the actual Twitter web site that I saw a quick error message pop up that pointed me to that support ticket.

Obviously if you do not tweet the same exact text, you are okay. In my case, I just started using other ZIP codes… like “90210″ and “12345″. (the latter being Schenectady, NY, of all places!)

An Example of How to Make a Tropo App Respond Differently to Different Channels (including Twitter)

Thursday, March 25th, 2010

Would you like to have your Tropo.com app respond differently depending upon which communications channel is used to connect to the app? Would you like to, for instance, have the app provide more of an introduction to voice callers but not for text channels like IM, SMS or Twitter?

Earlier today, I wrote about how to add Twitter support to a Tropo app and at the end of the piece I mentioned that my Yahoo!Weather sample application responded with more messages that I really wanted it to send via Twitter. In this post, I will show how you can use the “currentCall” session variable to tweak your app to respond differently depending upon which channel is being used.

First, let’s look at how the app originally responded via IM to a ZIP code:

tropobyIM.jpg

After one IM to the app I received seven responses! Not good. Perhaps in IM it might be okay, but in SMS or Twitter it is a bit too verbose.

REMOVING EXTRA MESSAGES IN TEXT MODE (BUT NOT IN VOICE)

If you look at those messages, the first and last messages are “extra” messages that introduce the app to the user and then clue the user into the fact that the app is done. We could just eliminate them, but then, particularly with the final message, we’re being kind of rude to the person who is calling in. We are just giving the report and hanging up. Perfectly fine in a text-based interaction, but not great for a voice interaction.

To modify the app to respond differently according to channels, we need to use the “currentCall” session variable. With that variable you have access to the parameters of the “callObject, including, most relevant to this issue, “channel“. So in python, my personal language of choice, I can add this at the beginning:

if currentCall.channel == "VOICE":
    say( "Welcome to the Tropo dot com sample Yahoo weather app." )

and this at the end:

if currentCall.channel == "VOICE":
    say( "Thats all. Goodbye!" )

With those two additions, I’ve now made it so that if you call the application at +1 (407) 374-3994 you will hear those phrases but if you use a text channel (SMS, IM or Twitter) you will not see those messages.

I then went through the python code and eliminated the multiple “say” commands so that the location, time, temperature and condition were all written on one line. The result is that now the interaction is down to 2 messages:

tropobyIM2.jpg

MORE TWEAKING FOR VOICE

This is obviously better, but notice that first message “Enter the ZIP code...“. If you hear that in a voice call, will you realize that you could either enter the ZIP code in digits on your keypad or say the ZIP code? Probably not… you probably think you can only use DTMF digits. So let’s change the prompt a bit:

if currentCall.channel == "VOICE":
    say( "Welcome to the Tropo dot com sample Yahoo weather app." )
    result = ask( "Please say or enter the ZIP code for a weather check", { 'choices' : "[5 DIGITS]" })
else:
    result = ask( "Enter the ZIP code for a weather check", { 'choices' : "[5 DIGITS]" })

Now we have a more friendly prompt for voice that clues people in to the fact that they can either enter digits or use speech recognition.

REMOVING THE INITIAL PROMPT IF DATA IS PROVIDED

The next step is obviously to get rid of that initial “Enter the ZIP code...” prompt for a text channel if a ZIP code is sent in the initial message. This points to a major difference between voice and text channels. With voice, you need to have that initial prompt. With text, the user can already know what they need to send and just send that data along.

The currentCall session variable also has a “initialText” parameter that includes the text sent by the user. So I can see that the next step I need to do is something like:

If currentCall.initialText is a valid ZIP code, don’t send the first prompt. If currentCall.initialText is NOT a valid ZIP code, or is just general text, do send the initial prompt.

Unfortunately: 1) I have to leave in a few minutes to catch a plane to fly back to my home in NH; and 2) I’ve been spending more of my days writing in PowerPoint versus python, so my coding is a bit rusty. My first reaction is just to do a try / except but I know I’ll need to play with it a bit. So I’ll tweak it some more later.

PLAYING WITH THE CODE

If you are a pythonista, you’re welcome to play with my sample app. I uploaded it to Github at:

http://github.com/danyork/tropo-twitter-weather-sample

If you come up with an elegant way to get rid of that initial prompt, I’ll be glad to write about your solution here.

And if you create a similar app in another language, I’m also glad to write about that here as well.

USING OTHER currentCall OPTIONS

Beyond “channel” and “initialText” there are a number of other interesting parameters found on the callObject reference page. While currentCall.channel lets you broadly differentiate between voice and text channels, currentCall.network lets you get even more granular and respond to specific channels differently. And of course currentCall.callerID is always a useful variable to have around.

With that, I’ve got a plane to catch… stay tuned for more…

How to Add Twitter Support to a Tropo.com App – Step by Step

Thursday, March 25th, 2010

Please note, Twitter & IM support have been deprecated, as per this blogpost. Please direct any questions or concerns to support@tropo.com.

With our new announcement of support for Twitter in Tropo.com apps, I thought I’d walk through the steps of adding Twitter support to an app.

I’ve got a basic “Yahoo weather” app that I copied from the Tropo tutorials and sample apps. You can call it today at “(407) 374-3994″, send it SMS at the same number, (407) 374-3994, or use Jabber IM to contact it at “danyahooweather@tropo.im”. You give it a US ZIP code (try “32801″ for Orlando) and it gives you a summary of weather.

Now I want to add Twitter support.

STEP 1: Login to your Twitter Account (either a new or existing one).

Obviously you first need a Twitter account to link to your app. You can use an existing Twitter account or, like I did, create a new one: @danweathertest. The next steps work best if you login to this account on Twitter.com before proceeding.

STEP 2: Start the Twitter activation process in Tropo.com.

Next you login to Tropo.com, click on the “Account” link and open up the application you want to link to Twitter (or create a new app – try one of the samples if you don’t have an app yet). At the bottom of the application info, you’ll see the tabs for the different channels you can use – click the Twitter “t” icon:

tropotwitter1-s.jpg

Just click the link to “activate Twitter”:

tropotwitter2-1.jpg

STEP 3: Allow the Tropo app access to your Twitter account.

You will now be taken to Twitter.com to complete the OAuth authentication process. If you did login to your (new or existing) Twitter account back in Step 1, all you need to do is click the “Allow” button. If you didn’t, or are logged into the wrong Twitter account, you’ll need to sign out of Twitter and login with the correct account.

tropotwitter3-s.jpg

After you click “Allow”, you will be redirected back to Tropo.com where you will see the message after a moment that Twitter has been successfully activated:

tropotwitter4-s.jpg

STEP 4: CELEBRATE!

That’s it! You’re done!

Welllll… you might want to test your app a bit to make sure that it works well with Twitter. For instance, when I send a tweet to my Yahoo weather bot:

@danweathertest 03431

I get back a flow of multiple messages:

tropotwitter5-s.jpg

Now maybe that is what you want… maybe it’s not. I think ideally it would summarize that report into a single tweet… but that’s an application implementation detail that I just have to go back and work on in the python code for my app.

WRAPPING UP

In just a few steps I’ve added Twitter support to an existing Tropo.com app so that this one single Tropo application can be reached by any of these channels:

Voice:

+1 (407) 374-3994
Skype: +99000936 9991438833
SIP: sip:9991438833@sip.tropo.com
INum: +883510001814088

SMS: (407) 374-3994
Jabber IM: danyahooweather@tropo.im
Twitter: danweathertest

Now I could go on and add a MSN account, AOL account, etc., but for the purposes of this example I’ll leave it at that.

That’s all there is to it… take out a Twitter account, do the OAuth dance, and there you are! I look forward to seeing what kind of Twitter-related apps you all create!

Tweeter Phone uses Tropo to read you your latest tweets

Friday, March 20th, 2009

Here’s exactly the kind of rapid innovation we were hoping to see with Tropo. Last night, a developer attends the monthly meeting of the Orlando Ruby Users Group which we hosted and where we demonstrated Tropo. He goes home, spends a few hours working on a site and… ta da…

Tweeter Phone!

You login with your Twitter credentials (yes, you have to provide your Twitter username/password at least until Twitter finishes their OAuth implementation), enter in your phone number and then whenever you call the application phone number from you phone you will hear the latest Twitter updates from the people you follow. Works great!

Now, okay… sure, for those of us with smart phones with Twitter apps or mobile web clients it’s probably easier to check Twitter updates from those interfaces… but if you don’t have such a phone or you don’t have a great data connection, this provides another way to hear what people are posting.

More importantly, in our mind, was the fact that this developer could go from knowing nothing about Tropo to launching a new communication service in a few hours. We love his About page:

Tweeter Phone was built by Devoh.

The initial version was spent in a single 5-hour, late-night coding session.

The phone service is powered by Tropo, the new cloud-based telephony service from Voxeo.

Kudos to “Devoh” for bringing out this service – and we look forward to seeing what else he (and you all) do with Tropo.

Speaking of Twitter (Hmmm… which is actually what his service does :-), you can of course follow us on Twitter at twitter.com/voxeo


If you found this post interesting or helpful, please consider either subscribing via RSS or following us on Twitter.


Technorati Tags: , , ,