First Impressions of the Twitter API

twitter icon

A couple of months back, I had an idea which could potentially increase Twitter‘s worth to me.

Up until a month ago, I attended school with, among many others, a small group of rather close-knit twitter users (euphemism aside, I mean geeks). We used and still use Twitter as a passive medium for random comments, status updates and importantly chat. One downside that I have always seen in using Twitter, especially as an open chat client, is the inability to divide your followers into groups and serve them content separately. For Twitter to implement this would be to completely betray the main purpose of their service, but still I have sometimes wanted to send a message to only my school friends. I wanted to a twitter bot (wrong word?) which would make that possible.

The basic idea of the bot would be for everyone in the ‘group’ to follow a protected bot user. Then in order to message only the others in the group, they would send an invisible direct message to the bot, which would then relay it in its entirety to all of its followers. In this way all of the accepted followers of the bot account would get the message, but it would be delivered invisibly to the outside community. The nearest you could come to achieving this goal in twitter otherwise, would be to directly message every ‘group’ member individually.

So, today I took a quick dip into Twitter’s API to see if my vision was workable. Conclusion: using a php server running a cron job every 5 minutes, it would indeed be possible. And even I should be able to do it. The two main downfalls are that messages could only be relayed in 5 minute intervals, due to limits associated with querying the API, and should more than 20 direct messages be received within a 5 minute period, the earliest would be lost in the nethers of Twitter’s dark underbelly. (Twitter will only ever serve you a maximum of 20 direct messages at once.)

Interaction with Twitter’s API can be done through the reading of and posting to special XML and JSON files, and in some cases RSS and ATOM feeds.

So, would anyone actually use such a system if I were to hack it together?

Resources:

15 thoughts on “First Impressions of the Twitter API

  1. To be honest, I think that if you implemented this, it would have very wide appeal. I’m sure lots of people would like to address messages to groups and this is equivalent.

    I’m not sure about the 5 minute/20 message limitation – either we’ll barely notice it or it’ll quickly become apparent that it doesn’t work. Even if the system can’t keep up with the quickfire group chats that often spring up, it’d still be useful for grouping messages.

    I think it’s worth pursuing as a project and you’d definitely have my support (not sure if that means anything)…!

  2. Sorry about, the funny commas, in my first sentence. Perhaps I think this would have very wide appeal if you implemented it would have been better.

  3. no edits! ;)

    Thanks for the input farhan. There’s obv. no point in me making something like this if no one else sees a need for it.

  4. Sounds good. Let me know how it goes.

    You may have thought of all of this before and decided against it but oh well… My take on it would be more a direct message client to which you can add the twitter users you want to receive the ‘private’ messages and then when you hit submit, it sends separate private messages to each user, perhaps with the message also containing a record of all the users who will have received this. That would surely take away the 5 minute issue and remove the need for your own server entirely? It would also stop the sender from receiving a copy of his own message.

    I may be totally missing the point, but from where I stand, something which takes a message and PMs it to all the preset recipients in a group would achieve the same thing. So long as all involved had the same recipient list (some sort of sync?) then the messages would always go to the right people and invisible to the world at large.

  5. Unrelated to this, but you may want to play with comments so that the first few words of the comment are not used as a title. Looks a bit messy and nonsensical…

  6. Michael, the main issue with a client that sends multiple direct messages is that each of those direct messages would count as an API request, limiting your possible outgoing messages quite severely. Is it an issue that you would get your own twitters? You do get them anyway in clients such as twitterrific.

    Thanks for the skin advice, it’s not mine but I should be able to give it a tweak.

  7. kk, I’ve tweaked the skin. The poster’s name is now the < h4 >, instead of the post excerpt.

  8. Yep, agreed that groups functionality in Twitter would have very wide appeal – maybe not for me personally right now (life stuff changing and all that). But last year, for example, it definitely would have done.

    Thinking about setting it up if you were to make it a public app – some kind of authentication with the bot, which means some kind of group ‘leader’? Interface for approving people who try and follow the bot… so, a list of ‘trusted’ people?

    Cool idea… shove something together if you have time, I’d like to see it :)

  9. It definitely sounds like a good idea and I doubt whether the 20 messages would be a problem as if you have less than 20 users then the case will be that most messages will be posted as a reply to another or the start of something new and therefore the person will have to wait 5 minutes before they get a reply and therefore before they send a reply to that. That was worded very badly but I hope you understood. I think it would be good to give it a go even if just to test the theory rather than using it full time. Good luck anyway!

  10. Pingback: Twitter group posting | Blög

  11. Michael, the main issue with a client that sends multiple direct messages is that each of those direct messages would count as an API request, limiting your possible outgoing messages quite severely.

    actually according to the API specs, SENDING messages or updates does not count towards your total 70/hour request limit… so message away. see the API

    regarding the 20 message request limit, you should be able to clear that with a combination of “since” and “page” API

  12. hey adam

    you seem to be an expert on the twitter API.

    do you know if it’s possible for a third-party social network to link a member of its’ network’s account to the person’s twitter account. and then let the user send direct messages from the social network via Twitter Direct Message to twitter friends?

    thx

    joe

  13. @joe yes. the implementation would be like that at ping.fm, but with the social network.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>