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.

Originally from Voxeo Blogs