Tropo is part of CiscoLearn More

Get Notified When Someone Mentions You on Twitter

Posted on November 9, 2010 by Adam Kalsey

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

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.

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!

2 Responses

  1. How To Get Notified via SMS When Someone Mentions You – And a Keyword – On Twitter…

    Would you like to receive a notification when you are mentioned on Twitter? Or more importantly, would you like to receive a notification when someone mentions your Twitter ID (or your company’s ID) and uses a keyword like “fail”? Over……

  2. is a little bit easier way to do this – it just forwards tweets to you as a DM, so they get sent to your cell or email or wherever you have DM’s sent to.

Leave a Reply