Thursday, April 14, 2011

[Programming] XMPP and Office Guru (Part 1)

I heard an idea one day.. They wanted some kind of 'online board' where everyone is duly accounted for. May it be that someone is on a meeting, or went out for coffee or whatever. Another thing they wanted was they wanted to have an in house chat application. I squirmed at the thought of building one just for that sole purpose when there are already gajillions of chat programs out there, open source, free, robust and would most likely work great. I dont see the point in reinventing the wheel if there is already a Michelin tire available up for grabs. Not to mention that it would easily integrate with any existing system.

To those who dont know, Google made a half baked embodiement of their intelligent search engine in a form of a chat bot.. Aka, Google Guru. Feel free to add him (or her) to your GChat ( and ask him (or her) simple things like "temperature manila" .. So why not create something like Google Guru, like Office Guru or something?

Please dont ask it the meaning of life, we already tried. Im wondering, if in the future, this guy would pass the Turing test.
So what Office Guru does is that, you add Office Guru to your chat application and tell it something if ever you plan on leaving your desk. For example "meeting at Coffee Bean" or "went to pee" or "on sick leave" then Office Guru would post that to the 'online board' where everyone could see and know where in the world are you.

So going to the technical side, you would need a server which has and XMPP server application. Google Chat uses the XMPP protocol so which, in theory you could use it to be able to have your Google Chat account communicate with the XMPP server.

I was looking for a quick and dirty solution for me to deploy to my Ubuntu home server, so I started Googling XMPP server and Ubuntu. I found several articles which seems to be a good lead

Well looking at the Google Chat api, it seems to be in beta, and is currently in labs.

Im not quite sure if im doing the right approach. What i actually want is:

My sever (running XMPP client/server or whatever, logged in to my Office Guru account) would accept messages from anyone and parse that message and then save that to a database.. which a webpage would look into that database to see the latest updates/messages from the user.

Apparently, looking a bit further, Google App Engine supports XMPP service.. This is exactly what I want. But unfortunately, Im really not good in speaking Java or Python.. I kinda wish that this setup could be emulated in my local server.

Good read though.

Ok. So I think I need to read more. Im gonna try installing an XMPP server and see the functionality from there.

Will update again for progress.

ps: I was kinda thinking of naming my guru, PogzBot .. Pretty neat huh?

pps: Im thinking of extending this by having an SMS gateway where you could text PogzBot and.. wait.. scratch that thought.. If I have an SMS gateway like Gnokii, it could directly write to the database.. I would just need a proper identifier which could link a certain cellphone number to an email account. No points for being unecessarily creative. Haha.

-- 10:47PM Logs Start --

ok let me try looking for the package if it exists
apt-cache search openfire 
seems like it returned empty. checked openfire website.. well there is a consolation.. it has some deb packages, which is probably compatible with my ubuntu server. well, lets try it.


clicked on linux platform. copy the deb link and issued a
command on the server to fetch the file.

why is it taking so long to resolve the domain? anyway, there it is, downloaded. great. now lets install the package ..
dpkg -i openfire_3.7.0_all.deb
well that was pretty much stupid, it downloaded it as
what? ok let me rename that..
mv download-landing.jsp?file=openfire%2Fopenfire_3.7.0_all.deb openfire_3.7.0_all.deb
lets try the previous command

ok still got an error
root@odin:/home/odin# dpkg -i openfire_3.7.0_all.deb
dpkg-deb: `openfire_3.7.0_all.deb' is not a debian format archive
dpkg: error processing openfire_3.7.0_all.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
not a debian package? are you blind? ok, i think there was a download problem. i tried heading on to the web browser and clicking the link directly.. as suspected, i was thrown into a new page which contained the link 'if the download window does not appear please click here" .. coped the link on the click here hyperlink.. that stuff is more reliable..
now we're talking.

reading through the manual found at

seemed to get me drowsy and sleepy. I was never a fan of reading manuals.

ok as expected, i skipped installing the java part. it threw a dependency error.

root@odin:/home/odin# dpkg -i openfire.deb
Selecting previously deselected package openfire.
dpkg: regarding openfire.deb containing openfire, pre-dependency problem:
 openfire pre-depends on sun-java5-jre | sun-java6-jre
  sun-java5-jre is not installed.
  sun-java6-jre is not installed.
dpkg: error processing openfire.deb (--install):
 pre-dependency problem - not installing openfire
Errors were encountered while processing:
I ran a quick apt

apt-get install sun-java6-jre
but for some reason, it says that its unavailable. what the? seriously. 

ok again, because i was skipping the manual, i skipped editing the repository to enable multiverse.
nano /etc/apt/sources.list
ran an apt-get update and apt-get upgrade after. 

still cant find the packages. oh come on. 

i think ill sleep for a while.

-- 10:47PM Logs End--