Original in a sea of techies?

July 24th, 2008 § 2

Well, apparently not. Tweet Party is a twitter application/client/extension/tag-along which allows you to make group messages. Its [ed. corrected] implementation looks sexy, so try it out if sounds useful to you. Thanks to Will Morland for the tip off.

Introducing Anna

July 22nd, 2008 § 3

This morning I finished the twitter bot I mentioned in my twitter api post. It has been named ‘Anna’ in homage to the Basshunter song. It’s twitter alias is @spsp (st pauls school private). It is written in PHP and is more than just a bit of a hack job as opposed to any quality programming. I have never before done any work with XML so my method of transferring it to a usable array probably deserves a fair bit of criticizm. Anyway, I’ll upload a zip of the script for anyone interested to use, improve on or just comment on.

Purpose:

  • Allows mass invisible messages by reposting a direct message to it to all those following it. (This is invisible as long as the bot itself is ‘protected’, which it is.)
  • Effectively creates a ‘group’ within Twitter.

Usage:

  • Follow @spsp
  • Direct message your message to spsp with the regular syntax. i.e. “d spsp @zethraeus I am testing your excuse-for-a bot”.
  • The message will be reposed as a regular tweet by the bot, without the initial ‘d sps’, but with your twitter alias signed at the end. i.e. the above message would be posted as “@zethraeus I am testing your excuse-for-a bot ~ @alias”.

Limitations:

  • The bot can not handle accented characters. It will cut off your message from the point the accented character is introduced. This is the case because of a quirk in php’s libxml2 functionality – and because I am not a particularly good or dedicated PHP programmer. This quirk is not a bug (apparently).
  • Should your message be above 140 characters once the ‘d spsp’ is removed and your alias is appended, it will be shortened in Twitter, and any clients like Twitterrific. It will require a click through to see the unabridged version. Whilst this isn’t a huge issue, it’s probably worth keeping the tweets a little bit shorter.
  • In theory, if the modified tweet exceeds 160 characters, it may not send. In reality, Twitter wont let you have a name long enough to make this occur in normal usage.
  • The tweets are passed on every five minutes. (This is a cron job)
  • The maximum processable tweets at each 5 minute slot are 20. I don’t know enough about the workings of http://twitter.com/direct_messages.xml to say whether any tweets exceeding the 20 will be lost into Twitter or just processed 5 minutes later.

The script is comprised of three files.

  1. process.php grabs all of @spsp’s direct messages since the last recorded id, records the new last id and reposts the direct messages as tweets.
  2. twitter.php, found at http://www.aimclear.com/code/twitter/twitter.txt is a modified version of the twitter api. It is responsible for actually posting the status.
  3. lastid.txt is simply used to record the id of last read direct message so that tweets aren’t posted twice.

All of these files are available for download and the bits that are mine, are in the public domain for you to do what you want with.

I just hope that people use it!

A brief note on Bluehost

July 22nd, 2008 § 0

My hosted account at Bluehost.com (on box194) was down for about ten hours today. I’m not hugely fussed as I wasn’t hosting anything of particular importance, or that I needed to rely on at the time. This is however the day on which I launch the twitter grouping bot, so it served as a fair reminder that I probably shouldn’t be relying on Bluehost for something which needs to have a 24/7 presence.

Apparently there had been an error with one of the hard disks in the server (I found this out by checking the server status myself), and I had been affected. Anyway, I lost nothing.

The factor which bugs me most here is that Bluehost did nothing at all to get in touch with me, apparently opting instead to hope that I wasn’t in the habit of actually checking or using my web space.

Is there any web host which you would casre to reccommend? I know Alex Muller hosts at Nearly Free Speech, and would recommend it.

First Impressions of the Twitter API

July 17th, 2008 § 15

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:

o, hai.

July 16th, 2008 § 1

Well hello again.

As a direct result of the encouragement of my peers [1,2] (read: 100% unrelated to, but I appreciate the gestures), I have opened a new website at zethrae.us. This time around it is going to be a true ‘personal web site’, in other words a place for me to experiment and play around.

I tried running this blög on Chyrp, which does seem to be a really nice lightweight. However, it wouldn’t let me update anythign in  my user profile, and once I logged out – I was stuck out. Now a more resolute person would tough it out and find if it was his flaw in installation, a flaw in the script or perhaps a server requirements issue, but I’m far too mercurial for that.

Keep one very lazy eye on this space.