Wednesday, January 24, 2007

Sametime bot shows latest Lotusphere2007 blogs

Today I've created a new bot function which shows latest 20 blog posts tagged with "Lotusphere2007" on Technorati. Took me 20 minutes to modify it from an old example of LotusScript agent and setup STWidget, the LotusScript agent code can be improved but it works.

It works like this: you type "Lotusphere2007" (not case sensitive) to sametime bot and it responds with the 20 latest blog posts. You can click the links in the result to read the post.

Here you can try the "Lotusphere2007" bot live:

Or just try it embedded at the end of this post with help of Sametime Widget.

Code of the LotusScript agent which bot calls to get the results:
Function AgentMain(doc As notesdocument)
Dim param As String
param= doc.ArgValue(0)
Dim objHttp, i
Set objHttp = CreateObject("Microsoft.XMLHTTP")
url = || "GET", url, False, "", ""
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.send("") 'send request to web server

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.loadXML (objHttp.ResponseText)
Set xmlLst = xmlDoc.getElementsByTagName("item")
For i = 0 To xmlLst.length - 1
Set xmlNode = xmlLst.Item(i)
Set att=xmlnode.childnodes
Forall child In att
If child.nodename="title" Then
tmp=tmp+Cstr(i)+". "+child.text+": "
End If
If child.nodename="link" Then
tmp=tmp+|<a href="|+child.text+|" target="_blank">Link</a><br/><br/>|
End If
If cnt=20 Then i=xmlLst.length
End Forall

AgentMain="Last 20 posts in category Lotusphere2007:"+"<br/>"+tmp
End Function



Anonymous said...

Hello Andrei,

how are you going?
I would like to get a copy of the Sametime widget code.
Can you help please?

Anonymous said...

Do you like playing the game where you need to use requiem gold, when you do not have requiem lant, you must borrow requiem money from friends, or you can not go on this game without cheap requiem lant. If you get requiem online gold, you can continue this game.
Do you like playing the game where you need to use maple mesos, when you do not have
mesos, you must borrow
cheap mesos from friends, or you buy
maplestory mesos. If you get
maple story mesos, you can continue this game.

Anonymous said...

I like play online game, I also buy mabinogi gold and mabinogi gold, the cheap mabinogi is very cheap, and use the mabinogi money can buy many things, I like mabinogi online gold, thanks, it is very good.

I like play online game, I also buy mesos and maple mesos, the cheap mesos is very cheap, and use the maplestory mesos can buy many things, I like maple story mesos, thanks, it is very good.

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.