My relationship with Twitter ebbs and flows. Sometimes I find it very enjoyable, and at other times it seems like a worthless distraction. However, there is one part of Twitter that I have never liked, direct messages.
Why not like direct messages? I’m not a fan of anything that creates another queue that I have to monitor and respond to. I try to keep everything in one workflow, and that workflow is email. My annoyance isn’t limited to Twitter direct messages, but extends equally to Facebook messages and any other website specific inbox. I think Facebook could actually do their members a huge service by making their message system IMAP-capable. It would make it infinitely more useful and you could happily sit in your choice of email clients. On the other hand I would rather just not deal with Twitter direct messages.
I’d thought for a while that part of a Twitter Pro premium service could be to turn off direct message function. I decided to take matters into my own hands and rid myself of direct messages now instead. You can use this little program to do the same for you.
The first thing to do is tell Twitter to stop notifying you of a direct message. Go to your account Settings and in the Notices tab uncheck the Direct Text emails option.
![]()
Now, this 28-line Ruby program will simply respond (via direct message) to any direct messages you have received and then delete the direct message from your account, leaving no queue behind. If you don’t like the delete, you can just comment out line 24. To make life easy this uses the Twitter4R library for Ruby. You will have to edit lines 9 and 19 to your credentials and personal message.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Get requires out of the way require('rubygems') gem('twitter4r', '>=0.2.0') require('twitter') require('time') # Let's get a Twitter Client created # TODO: Put your credentials in here client = Twitter::Client.new(:login => 'USERNAME', :password => 'PASSWORD') # Get Direct Messages messages = client.messages(:received) # Loop through any direct messages received messages.each do |message| # Reply to the message # TODO: set the message text to what you want, make sure it is Twitter length compliant response = Twitter::Message.create( :text => 'PUT YOUR MESSAGE HERE. YOU PROBABLY WANT YOUR EMAIL IN HERE.', :recipient => message.sender, :client => client) # Delete the message client.message(:delete, message) # Put a brief pause here just to make Twitter happier sleep 5 end |
There is no error checking and by default it outputs nothing. It is intended to be invoked via cron at whatever interval you would like. If you do not have the Twitter4R Gem installed just run gem install twitter4r.
Duly noted.
Jamie,
Pretty neat easy to run program. However, I don’t find the DM as annoying as some, mainly because I do not check it on a regular basis. On Twitter, when I click to check it, I click to check it. Hopefully people learn that I do not use it like email. I thought it was a good feature when I used to be able to set DMs as a text message. I miss the text alerting capabilities of the original Twitter (before the issues).
As for the email system, while I can agree that the most user friendly thing to do would be to support IMAP, that would remove one of the key values to offering the service to begin with: bring users back to the service to respond and hopefully see any new enhancements that can increase repeat visits and higher overall user utility. I think FB did the right thing by putting the message of the sender in the email notification, that is a lot more user friendly than “click here to see the message”.
@Lou,
I’ve had a couple of direct messages fall through the cracks lately. I might go a couple of days or longer without looking at Twitter in any manner where I can see a direct message and have missed them.
There is one use that even I get out of DM’s though, and that is getting email addresses if I don’t have it. Luckily my bot autoresponder will provide that on my behalf. ;-)
Twitter. Check. But do you know how to turn off the “private messages” or “direct messages” feature for faceBook? I get FAR too many. Thanks! ch:
I don’t get a lot of these Facebook messages myself, but I do agree that it is annoying to have yet another queue of messages that you have to check. I would love it if Facebook simply released an IMAP interface to their messaging system so I could see it in my preferred email program. I don’t believe there is a way to not get messages.
{sigh}
Thanks anyways!
ch: