Google Talk now comes with translation bots. While translation is fun, even more fun is to build your own bot! And with the Smack library, it's also easy.
As an example, here's a simple echo bot implementation in 40 lines:
public class EchoBot {
private final XMPPConnection conn;
// Simple bot that echoes incoming messages.
private EchoBot() throws XMPPException {
// Login as my-bot@gmail.com with password "my-password".
conn = new XMPPConnection("gmail.com");
conn.connect();
conn.login("my-bot", "my-password");
// Become available.
conn.sendPacket(new Presence(Presence.Type.available));
// Auto-accept all friend requests.
conn.getRoster().setSubscriptionMode(SubscriptionMode.accept_all);
// Echo incoming messages.
final MessageListener messageListener = new MessageListener() {
public void processMessage(Chat chat, Message message) {
if ((message.getType() == Message.Type.chat
|| message.getType() == Message.Type.normal)
&& message.getBody()!= null) {
try {
chat.sendMessage(message.getBody());
} catch(XMPPException e) {
e.printStackTrace();
}
}
}
};
conn.getChatManager().addChatListener(
new ChatManagerListener() {
public void chatCreated(Chat chat, boolean createdLocally) {
chat.addMessageListener(messageListener);
}
});
}
}
Feel free to re-use the code and go build something awesome!








An interesting story about a Chinese couple that are refusing to abandon their house is spreading in the sphere, read the (translated) 








Another thing that irritates me is how the iPod displays music by Artist. Some artists' albums feature many other artists, and for these the iPod will display one line per unique combination of artists. I have for example row displaying "Jay-Z" and 19(!) rows that start with "Jay-Z Feat.". If I choose the plain "Jay-Z" option and then an album, the iPod plays the songs in the album that are "only" by Jay-Z, i.e. no featuring artist. When choosing "The Dynasty..." I get 4 songs, even though the album really contains 16. The only way I can play all songs is to go back to the top menu, display music by album and then choose this album.







