@madpilot makes

Proposal: An open inter-conversation microblogging protocol

Spurred on by Gary’s discussion on the number of micro-blogging sites around, the “Is it Distributed?” question made we wonder if we are going about this wrong. Cameron Adams was right when he said there is only one social network, so why are we flicking between a large number of them? Why aren’t we running out own?

Beyond a number of small superficial differences they all do the same thing – you add friends, post what your doing (usually in an arbitrary 140 characters or less) and read what others are doing. There really is no reason why this can’t be truly distributed, i.e. I can run my own micro-blogging site, and all my friends can run their own micro-blogging sites – all that is needed is some glue (a communication protocol) to bring it all together. The great thing about this, is we already have systems to make this happen – get your buzz-word bingo cards out people…

RESTful XML

The first part of this system is a RESTful API that allows friends to post information in your timeline and you to post to others. Everytime you post to your microblog, it will iterate through your list of friends and forward the message on to them. The same thing happens if you delete a post – if notifies all your friends to remove the post from their local database. To ensure that random people can’t spam our feeds, we can use OAuth to give “friends” permission to send us information.

Your own timeline

The reason that your microblog would need to be notified of other peoples posts would be so you can cache these posts on your own microblog, which gives you a twitter style public timeline. The advantage of this is that there is basically no database load to display YOUR feed – the only information in your database are the posts that you want to read!

Adding friends

So how can you add friends and allow others to follow you? This is actually pretty easy using OAuth – by adding your microblog to your friends microblog authorised list, they know that you need to be notified on an add or delete command. This gives us the side effect that we can manage not only who we follow but who follows us – if you want to stop someone from following you, you just de-authorise them. So what happens if a new friend adds your microblog to their timeline? A simple GET command could be made to receive all of the posts by the new friend, effectively syncing up the two databases – all future posts will obviously push to the new friend (and vice-versa) so there is no expensive polling.

Other peoples timelines

If someone has a public timeline, this is a no-brainer. Each persons microblog would just be available and others can just read it. But what about private timelines? Enter OpenID. If each of your friends provide an OpenID URL, they would be able to login to your microblog to read your private feed – no password required, but is still totally private.

Discovery services

Many twitter users scour the public timeline waiting for people to post things that they are interesting in. This is actually quite easy to implement on a distributed system – have a read only super node that everyone posts to. Voila, instant public timeline. This also means that you can easily create “channels”. Instead of only having one public timeline, you can have many based on different topics.

Unlimited extensions

One of the value-adds for Pownce is the ability to share attachments and events. In reality, all it does is provide a link to a file on a remote service. If you wanted to add this function to your microblogging site, you can quite easily – as long as you post the link to others. This means you have complete control over what your microblog does, as long as it still talks the protocol.

Advantages

  1. The obvious one is you aren’t at the mercy of servers doing a twitter (ie. being up and down like a yo-yo). If your friends server goes down you miss out on their posts, but no one elses.
  2. You have control over your data – you don’t have to worry about a service disappearing overnight and you not being get at it. It all on your server
  3. Distributed data – your server dies and your harddrive explodes, your data can be rebuilt from the data that is stored on one of your friends databases

Disadvantages

  1. If someones site is down they may miss some updates, so you would need a method for re-syncing all friends posts from a certain date – no biggie.
  2. It does make completely removing your account difficult as you can’t really ensure your friends are going to respond to delete commands correctly

So what do people how don’t have their own server to run this on? This is the kicker – you can still have hosted versions of the system. This works for blogs (I host my own, but some of my friends use systems like Blogger.com) and OpenID which makes it much more accessible.

If there is some interest in this, I’m sure we can start drafting some specifications. I’d be interested in your thought.s

You can’t do that on Twitter

Ok, I REALLY have to stop coming up with hare-brained ideas, and then listening to others when they convince me to implement them.

Spurred on my @cybner‘s new avatar, I thought it would be cool if you could slime people in Twitter if the say “I don’t know”.

So after a couple of hours of ruby hacking, I came up with: You can’t do that on twitter. Eveytime someone says the magic words, you should see their avatar get slimed! You can even try the public timeline or your own timeline (Click here and and change madpilot in the url to your username). Note though, that because this isn’t authenticated, your timeline will need to be public for it to work.

You can’t do that on Twitter

How it works

It is all very simple, using Ruby CGI, Mechanize and Hpricot. The steps are:

  1. Work out what page is requested (uses apache mod_rewrite for this)
  2. Build the twitter URL, and request it using Mechanize
  3. Parse the HTML using Hpricot
  4. Append a new JavaScript file, which inserts the slime image based on an inserted class name
  5. Iterate through the tweets, grepping for the term “I don’t know”. If it finds it, it inserts the “slime” class
  6. On window.load, the inserted JavaScript file finds all images with that class and dynamically inserts the slime.png image above it. Using the twitter prototype instance, it gets placed over the avatar image.

I started off using Mechanize, then realised I didn’t really need it, but left it in there as it does do the HTTP request thing quite well. Download the source. Enjoy!

Update: Some good old You can’t do that on television sliming:

I can haz meraki?

You see this is what happens you take up challenges from Twitter. It was suggested by Laural and Gary that it would be handy to have a map of all the Australian Meraki nodes – of course being a stickler for a challenge, I duly accepted. Unbeknownst to me, the challenge was also being accepted on the other side of the Nullabor, but Ajay. Although an interstate game of “Who can build a Google Map mash-up in the fastest time” sounded like fun, we decided to combine our powers for good and not evil.

And so http://icanhazmerki.net was born.

Using the Public API that the Merkai website has we have been able to know up a quick mashup. So some instructions:

Ingredients

  1. You need a Meraki (Go figure)
  2. You need an OpenID account

Method

  1. Go to http://account.meraki.com and login using the email address and password you used when you set the merakis up
  2. Click the Configure tab
  3. Click the Advanced Link
  4. Find the Public API section – select either Most or All from the Radio buttons.
  5. Click “What is this?” – make note of the API URL (Looks like http://public.meraki.com/network/[username]/api)
  6. Click Save Changes
  7. Go to http://icanhazmeraki.net and click login
  8. Enter your OpenID URL – then register
  9. Click “Add/Edit network”
  10. Paste in the API URL
  11. Hit Save
  12. Add salt to taste

Enjoy! A big thanks to Ajay for his front-end wizardy and hosting donation – was much fun working with him – the man needs to sleep :)

Get all this summer’s cricket action – via twitter!

Are you a Australian? Are you a cricket fan? Are you on twitter? If you answered yes to all of these questions, you might be interested in the Twitter bot that I just coded up. Using the fantastic cricinfo.com website, some Hpricot trickery, the Twitter gem and some Ruby jiggery pokery you can get a ball-by-ball commentary of the Aussies beating everyone in there path.

So head over to http://twitter.com/baggygreen and get your summer cricket fix!

How it works:

  1. I used the WAP version of the cricinfo website, because the HTML is much simpler to deal with. First I find all games that Australia are playing. The front page has a list all all games in progress. Doing a string comparision, I grab the URLs to any Australian games.
  2. Using Hpricot, I parse the HTML from the commentary page, pulling out the score, overs, balls and commentary using X-path.
  3. I keep track of what I’ve already posted in a text file. Any new comments are posted to Twitter. If the script detects the end of an over, the score is posted as well.
  4. The script runs as a crob job every 5 minutes

Nice an easy, eh?

Update: Download the code! Excuse it’s less than optimal solution – it was hastily written :)

New version of Twitteresce available

After a long hiatus from development (I’ve been busy ok!) I’ve just released a new version of Twitteresce – a mobile client for Twitter. New features include:

  • The ability to delete your tweets and direct messages
  • A correct “sent from” string on the web site version
  • Other small bug fixes

So point you mobile browser at http://www.madpilot.com.au/twitteresce and download version 0.9.

Get your very own 09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0 hex colour t-shirt!

The new swanky HD-DVD T-shirt!After the huge Digg fiasco today, the twitterati, after seeing my hex colour representation of the HD-DVD crack code, thought it to be a good idea for shirts to be made up. Well, I though it was a pretty good idea too!

I’ve created a site where you can pre-order your t-shirt. Once the price is finalised (probably around $AU35 + p/h) I’ll email you a discount code (probably a $5 discount) and you can get your hands on one of these pieces of history!

The shirts will have the colour swatches on the front, will be black (what good geek tee isn’t?), but more details will become available as I get them.

Once the shopping cart goes live, you won’t be able to get discounts any more.

Don’t miss out! All the cool kids will be wearing them!

Twitteresce 0.7 released

I just released version 0.7 of twitteresce. This release fixes a couple of bugs with the automatic updating system, displays how long ago tweets and direct messages were posted and it now remembers what tweet you were looking at when flicking between the tweet view and read tweet view – trust me this makes catching up out the twitterverse much easier!

As always, get it from the MadPilot website.

In ur mobilz sending ur tweetz

Twitteresce 0.5 has been released! This update includes:

  1. direct messaging support: you can now read you direct messages
  2. the ability to “Close” Twitteresce rather than exiting – this means you can leave Twitteresce in the background. It will then popup and alert if you are running in automatic mode and you have a new tweet.
  3. a fix for the annoying bug where the the post screen would disappear if new tweets arrived.

You can download here.

Enjoy!

Edit: Had to release 0.6 to fix a regression bug – Sorry!

Twitteresce: Twitter on your mobile

I’ve got the Twitter-bug bad. Real bad. So much so that I’ve spend a large chunk of my leave this week learning J2ME (Java for mobile phones) by writing Twitteresce. Twitteresce is a small app that runs on you Java-enabled mobile phone – currently it allows you to download both public and private tweets and post updates.

I think it is so much more convenient than trying to use the twitter web page on your phone, or receiving SMSs because you can receive your tweets when you want (The API also seems more stable than the SMS alert system).

There is a list of compatible phones of the twitteresce web page, but I know the list is no where near complete. If you download the app on a phone that isn’t listed and it works, please let me know and I’ll add it to the list.

You can go to the official webpage the app here or type in http://tinyurl.com/2de636 into your phone browser and download it directly.

Any bugs, let me know.

Enjoy!