Archive for the ‘Twitter’ Category

Customer Spotlight: Zapier

Friday, December 16th, 2011

We are excited to feature Zapier on this week’s Tropo Customer Spotlight! Today I sat down with Wade Foster, one of the co-founders of Zapier, to discuss their business and learn more about how they are using Tropo for their Instant Messaging services.

What is Zapier?

Zapier allows you to “zap your apps!” You can build unique integrations between your favorite applications, one mouse click at a time without writing a single line of code!

  • Own Your Data: Zapier makes it easy to import and export data automagically with your favorite web apps. Don’t get locked in.
  • No Data Entry: Quit filling out the same information between different applications, and let Zapier do the heavy lifting for you.
  • Fill-in Missing Features: Never be at the mercy of vendors to build features or integrations. Use Zapier to add missing functionality.

Zapier uses Python, Django, and the Tropo Scripting API to deliver Instant Messaging services to users on AIM, GTalk, MSN, and Yahoo!

To learn more about Zapier, visit their website at http://zapier.com!

Here is a screencast of Zapier using Tropo for their Instant Messaging services:

Tweetchat Mobile Lookup Powered by Tropo

Tuesday, February 15th, 2011

Twitter chats – also known as “tweetchats” – are meetings on Twitter. They are usually moderated by an individual or group and meet at a set time each week or each month. They can be on any topic, and they are sometimes associated with businesses or non-profits. Tweetchats have been described as a way to “filter out the chaotic mass of tweets” to focus on a specific topic.

Tweetchats are very popular, but many Twitter users don’t know what they are or how to participate in them. In simplest terms, tweet chats are online conversations, typically held at a pre-arranged time, between a group of Twitter users, and using a specific Twitter hashtag to identify the discussion.

Eric Bryant, Director at Gnosis Arts Multimedia Communications LLC, recently reached out to me on Twitter to share with me a link consisting of existing Tweet Chat time schedules for people to get started and participate in these chats online.  If you participate in Tweetchats, then you know how hard it is to remember the dates – especially seeing as how they’re growing so fast and there are so many of them in existence already.  Anyone can edit the Wiki, all you need to do is create an account.

So here is where Tropo comes in!  Eric and his team created a Tweetchat Mobile Lookup application.

Text a hashtag or a day to 1.513.655.2216 and it will send you the day/time of the tweetchat. Your mobile number is encrypted and never seen or stored.

Now you will never worry about missing a Tweetchat again :)

Scaling Your Twitter Support, Part 2: Triggering Alerts on Keywords

Thursday, December 9th, 2010

twitterlogo-shadow-2.jpgIf you want to scale your usage of Twitter and do more than just set up a “night service” (discussed in Part 1 and Part 1a), how about we create an app that triggers alerts based on keywords that appear in replies or mentions directed to your account?

In our Developer Jam Session webinar last week (recording and slides available), I demonstrated this app, but I thought I’d walk through it here. To use this app, you need a (free) Tropo account and you need a Twitter account to which you can attach the app.

NOTE: If you are not sure about how to link Tropo apps to Twitter, you may want to visit this step-by-step walkthrough first.

The code for this example is available from Github and you can use the raw URL if you want to get a version you can easily copy/paste.

Once attached to a Twitter account, the app will receive all replies (messages starting with your Twitter ID) or mentions (messages including your Twitter ID) and act as follows:

  • Convert the message to all lowercase for easier matching.
  • If the tweet includes the word “fail”, send out a SMS to someone so that they can know to go online and look at the Twitter stream.
  • If the tweet is a “reply” and includes the word “help”, sind back a message with a URL and send out a SMS alert.
  • If the tweet is a reply and includes the word “faq”, reply back with the URL to a FAQ.
  • If the tweet is a reply and includes the word “documentation”, reply back with the URL to the documentation.

Obviously, you could make it do more… and make it a bit smarter – for instance to also search on “docs” – but this is mostly a demo of what you can do.

Now, to use this app yourself, you’re going to need to do two things:

  1. Replace phone number with your cell phone.
  2. Replace Twitter ID (“tropohelp”) with your Twitter ID

Here is what the full source code looks like. I’m using Python, because that’s how I roll, but you could apply the same ideas in other languages.

text = currentCall.initialText.lower()

if text.find("fail") > -1:
    message("Whoa! " + currentCall.callerID + " is tweeting a fail",   {"to":"tel:+14075551212", "network":"SMS"})

elif text.find("@tropohelp") == -1:  

    if text.find("help") > -1:
        say("Tropo lets you build apps that interact via voice, SMS, IM and Twitter. See http://www.tropo.com/ for more.")
        message("Tropo help request from: " + currentCall.callerID, {"to":"tel:+14075551212", "network":"SMS"})

    elif text.find("faq") > -1:
        say("The Tropo FAQ is at https://www.tropo.com/docs/scripting/faq.htm")

    elif text.find("documentation") > -1:
        say("Tropo docs are at https://www.tropo.com/docs/")

Now lets walk through it. First, I take currentCall.initialText, which contains the tweet message, and convert it to lowercase and put it in the text variable.

text = currentCall.initialText.lower()

Next, if that tweet includes the word “fail”, I’m going to use the message command to send out a SMS to get someone to look at it. I’m using the python “find” method which will return “-1″ if the text is NOT in the string – otherwise it will return the location of the text in the string.

if text.find("fail") > -1:
    message("Whoa! " + currentCall.callerID + " is tweeting a fail",   {"to":"tel:+14075551212", "network":"SMS"})

Next I check to see if the message is a “reply”, i.e. a message directly to the Twitter account. If so, I check the message for different keywords and take actions.

The reason for not sending messages out in reply to a “mention” is that it may be harder to guess exactly what the person is looking for based purely on a keyword. With a message sent to the account (a “reply”) you have a better chance of replying with accurate info.

The way I know is by testing whether or not the Twitter ID (“tropohelp” in this case) is in the tweet. If it is a “reply”, Tropo strips out the Twitter ID from the very beginning of the tweet (allowing you to treat it very much like an IM message or SMS message).

So I am testing for the absence of the Twitter ID to show that it is a reply:

elif text.find("@tropohelp") == -1:  

    if text.find("help") > -1:
        say("Tropo lets you build apps that interact via voice, SMS, IM and Twitter. See http://www.tropo.com/ for more.")
        message("Tropo help request from: " + currentCall.callerID, {"to":"tel:+14075551212", "network":"SMS"})

    elif text.find("faq") > -1:
        say("The Tropo FAQ is at https://www.tropo.com/docs/scripting/faq.htm")

    elif text.find("documentation") > -1:
        say("Tropo docs are at https://www.tropo.com/docs/")

That’s it! A simple and easy way to test for keywords in tweets and take actions based on what you find.

Have fun with it… and if you develop some cool improvements to the app, please drop us an email or leave a comment here.

P.S. And remember the duplicate tweet issue when you are testing your app!

Scaling Your Twitter Support, Part 1a: Tweaking the “Night Service” app a wee bit

Thursday, December 2nd, 2010

If you look closely at the code for nightservice.py that I mentioned yesterday in the post about 5 sample Twitter apps (and also posted the source code to Github), you’ll see that it is slightly different. Here was the original I wrote about back in May:

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()

And here is new version:

from datetime import *

if currentCall.initialText.find("@stratohelp") == -1:
    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 our web site at www.tropo.com")

Two main differences:

1. You no longer need to include “answer()” and “hangup()”. It just made sense to make those defaults. You still can include them if you have some need to do so… for instance using “hangup()” if you want to do some post-call processing after a call is terminated… but you don’t need to do so.

2. Switched the order of the IF statements. My main reason for doing this was so that I could add an “else” statement so that the app performs some action during work hours. My personal interest was that from a demo point-of-view, it’s rather lame to tweet a message to a demo app and receive, well, nothing if it is during “work hours”. The resulting code looks like this:

from datetime import *

if currentCall.initialText.find("@stratohelp") == -1:
    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 our web site at www.tropo.com")
    else:
        say("Our offices are open. We'll reply back to you soon.")

That’s why I made the changes to the code. Have fun with it… and if you build a cool Twitter app on Tropo please let me know and I’d be glad to feature it here in the blog.

Want to play with building Twitter apps on Tropo? Here’s source code for 5 sample apps.

Wednesday, December 1st, 2010

twitterlogo-shadow-2.jpgIf you listened to yesterday’s Developer Jam Session, a good part of it discussed building Twitter apps on top of Tropo (slides are available). I’ve made the source code available from our Github account at:

https://github.com/tropo/tropo-twitter-samples

You are welcome to copy/paste that code into your own Tropo account and start building Twitter apps! (and Tropo accounts are free if you don’t have one already)

The five sample apps are:

  • twitter-helloback.js – A one-line “hello world” example that in reality is rather pointless, but shows all you need to do. It was written in JavaScript but could be done in any language. You can see this in action by sending a tweet to @tropohello
  • nightservice.py – An improved version of a python app I wrote about earlier this year that could be used to provide a “night service” when your staff goes home for the evening. You can try this app by tweeting to @stratohelp
  • twitter-keywordalerting.py – Scans Twitter replies or mentions for certain keywords (fail, faq, help, documentation) and then either sends someone a SMS alert or replies back with specific messages. You can try it out by tweeting to: @tropohelp
  • clubtropo.js – A simple JavaScript app that replies back with a message if you send it the correct phrase. Could be used for a contest or to let people RSVP. My colleague Justin Dupree wrote up a great step-by-step walkthrough on how to get started with this app. You can try it at, of course: @clubtropo
  • yahooweather.py – A new version of the python weather app I first wrote about back in March (and wrote later about how to tweak it for different channels). Tweet a US ZIP code to the app and it will tweet back the latest weather conditions. Try it out at: @danweathertest

I’ll probably add some more apps to the repository over time as we have some other good Twitter samples (and please contact me if you have a sample app you would like to contribute).

If you do try these out in your Tropo account, remember to watch out for duplicate tweets when you are testing. (I’ve been caught by this in testing any number of times.)

Have fun with it… and we’re looking forward to seeing what you will build with Tropo and Twitter!

P.S. Speaking of Twitter, are you following us on Twitter? We’re at @tropo, @voxeo, @phono and more…

Reminder: Beware of Duplicate Tweets When Testing Twitter Apps on Tropo

Wednesday, December 1st, 2010

twitterlogo-shadow-2.jpgAre you building a Twitter application on top of Tropo? As a result of yesterday’s Developer Jam Session on building Twitter apps I know that a number of folks are trying it out… and one detail bears repeating when it comes to testing your app in development:

Twitter rejects duplicate tweets!

Where a “duplicate tweet” can best be defined as:

The identical text sent to the identical Twitter account in some period of time.

Let me show some examples…

Sending Duplicate Tweets TO Your App

I touched on this in a post here back in March and mentioned that I had a problem sending tweets to my Tropo app because I was doing this:

@danweathertest 32801
@danweathertest 32801
@danweathertest 32801

The first tweet would make it to my app and it would respond. The second and third tweets never made it to my app. In fact, they don’t make it to Tropo. Twitter kills the duplicate tweets before they even go out into the Twitter network. (And many Twitter clients will now notify you that the duplicate tweets are rejected.)

Now, the simple way to fix this is to vary your tweets in testing:

@danweathertest 32801
@danweathertest 03101
@danweathertest 32801

That’s enough to not run into the duplicate tweet rejection issue.

Sending Duplicate Tweets FROM Your App

Keep in mind that this also affects tweets your app sends. I ran into this testing @tropohello, one of the demo apps I used in yesterday’s webinar. I sent:

@tropohello hello

and received back:

@danyork Hello there, @danyork. Thank you for trying this out!
Build your own Twitter app at http://www.tropo.com/

Conscious of the duplicate tweet issue, I sent next this tweet:

@tropohello hi there!

And got back…..

nothing!

I could see in the Tropo Application Debugger that my tweet was making it to Tropo. I could see that it looked like the correct response was being sent back. But I never received it on Twitter.

You’ve probably figured out the reason… Twitter was rejecting the duplicate tweet from my app.

It was the identical text sent to the identical Twitter ID within some period of time.

Now in this case the @tropohello app is an extremely dumb app – it just spits out the same text all the time. But if you create such an app… or are sending identical text back to someone on Twitter, you need to be aware of this duplicate tweet issue.

The Time Factor

You’ll note that I put the caveat above “within some period of time”. It’s not clear to me the time period in which Twitter restricts duplicate tweets. I know that I’ve sent a tweet in to a Twitter app and then the next day sent the same exact tweet – and it has worked. But I don’t know how much shorter the time period is. Is it within a few hours? half a day? I don’t know.

The net of it is that you need to be careful with duplicate tweets… both going to your Tropo app – and coming from your Tropo app.

In particular if you are testing certain keywords or commands, you may need to be creative… for instance by using multiple Twitter accounts to do the sending.

JavaScript Goes First Class With Tropo

Tuesday, November 30th, 2010

In the last couple of years, there have been some significant changes in the development landscape that have elevated the status of JavaScript.

Lots of hard-core developers and engineers used to look down their noses at JavaScript as something only front-end “designers” used to make web sites look pretty.

And while the advent of AJAX-driven web development and powerful frameworks like jQuery have eroded this sentiment somewhat, a few key tools have developed in the last couple of years that have really vaulted JavaScript into first class status in the development world:

  • CouchDB – the document-oriented database that uses JSON for document structure and JavaScript for map/reduce functions.
  • Node.js – a framework for the V8 JavaScript engine from Google that lets you write sophisticated, event-driven applications in JavaScript.

In addition, the Tropo platform lets you write powerful, multichannel communication applications in pure JavaScript. Here is an example of a very simple Tropo application in JavaScript:

say("Channels are like hugs, more are better.");

One line – that’s it!

This script can be hosted and run in the Tropo cloud (much like how Google AppEngine works) and provisioned across multiple communication channels – phone, SMS, IM and even Twitter.

You can serve this humble message up to inbound callers, or send it out over all of the channels mentioned previously by kicking off an outbound session. Your choice.

Tropo blows the old notions that you can’t build powerful applications with JavaScript and that building communication apps is hard right out of the water. But what’s even cooler are the synergies that are possible when you mix up all this JavaScript goodness.

For example you can also build Tropo apps with Node.js using our WebAPI platform. Just download our Node.js library from GitHub and use the examples included with it to get started.

In addition, Tropo plays very nicely with CouchDB and you can build some really sophisticated apps that combine Tropo, Node.js and everyone’s favorite document-oriented database. (Look for a future post to cover Node.js + CouchDB + Tropo apps in detail.)

So if you’re a JavaScript ninja, or just someone who has used it on past projects, the time has never been better to sink your teeth into some exciting new applications.

Sign up for your Tropo account today and celebrate JavaScript’s promotion to first class status!

Get Notified When Someone Mentions You on Twitter

Tuesday, November 9th, 2010

Buzz, Buzz, Buzz.  Everywhere you turn today, people are talking about Twitter. Many people use Twitter to stay connected to their friends but savvy social media experts and businesses know that Twitter is where people conduct business.

People talk about brands, experiences, and things they are interested in purchasing or have just purchased.   Twitter never sleeps and neither does your competition.  We are living in a world where everything happens in real-time, online.

Wouldn’t it be nice if you knew when someone mentioned you or your brand online?  Wouldn’t it be even nicer if you could receive a message like an SMS when they do?  What about auto-responding with a tweet based on what they tweeted?

You can do this and more with Tropo’s Twitter API with as little as a single line of code running on our servers using the Tropo Scripting API!  We’ll show you how to listen and automatically take action when someone mentions you or your company’s brand.  Our first example will listen for your mention and simply send an SMS message to your phone to alert you of the mention as it happens.  There is no need to write a bunch of programmer logic for searching Twitters feeds or cron jobs to poll for tweets.  Tropo handles all of that magic for you automatically.

Simply log into your Tropo account and click on Create an Application and then Tropo Scripting.

Next, give you application a name and then click on the Hosted File link and then Create File.

We’re going to write a little Ruby script that runs whenever a tweet comes in on our linked account.  Copy and paste this code into the browser’s editor and click Update File.

message "Mention: " + $currentCall.initialText, {
:to => "tel:+14805551212",
:network => "SMS"}

Remember to change the telephone number to your mobile number.  After clicking Update File, you will need to click on Add a new phone number to your application so that your SMS messages will go out using your own phone number attached to your application.

The only thing left is to link your Twitter account to your new Tropo application.  Click on the Twitter icon and the on the Click to activate Twitter link.  Tropo will ask you to OAuth with your Twitter account and that’s it!

Now we wait…  or if you are like me ask one of your friends to @mention you in one of their tweets so you can receive an SMS text message alerting you of the Twitter mention.

Can you imagine all of the things that you could do with this script from here?  What if you autoresponded to the tweet to say something like, “I heard that!” or what if you reacted based on keywords mentioned in the tweet like “#fail” or “bad service” – not that this would ever happen but no one is perfect.  You could simply add a conditional statement around your action like this:

if $currentCall.initialText.index("fail")
     autorespond or send sms or place call etc.
end

The thing to remember with Tropo is that if you can imagine it, you can build it!  Let us know what you have built using our APIs.  We would love to brag about you!

New Tropo Powered Startup – VivaGrams!

Monday, October 25th, 2010

Tropo was a proud Gold-level sponsor of Startup Weekend Phoenix this weekend.  Chris Matthieu was onsite participating in the event and was able to work hands-on with the team behind Marc Chung and Natalie Melchiorre’s brainchild idea, VivaGrams.com.

VivaGrams was pitched as a wellness startup helping early adopters change their behavior to become healthier and happier people.  Users of the site could work with their care providers to establish healthy nutritional and/or exercise based programs and receive reminders via phone calls, SMS text messages, or Twitter.

Of course, VivaGrams used Tropo for its Voice, SMS, and Twitter integration.  Within the first 15 minutes of the competition, Vivagrams was sending out SMS messages.  Within the next 30 minutes we were placing phone calls to users and collecting input via speech recognition.  The call script was as follows:

1. This call is from Vivagrams.

2. Did you eat your banana today? Say yes or press 1 or say no or press 2.

3. On a scale from 1 to 10 with 10 being awesome, how happy are you today?

4. Keep up the good work!

Next we added Twitter support to VivaGrams using the Tropo API.  We were initially looking to add Twitter support as Direct Messages but DMs are on the roadmap for a future delivery.  Instead we integrated Tropo as public tweets/mentions and found this to be as simple as sending and receiving SMS messages.  The only difference was linking the Twitter account and specifying Twitter as the network.

We proved that it was totally possible to build a company including the technology, brand, and business model in 54 hours!  We met a bunch of new friends and awesomely creative people from this event.  Here are a few other photos from the event!

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!