Created
January 28, 2010 13:34
-
-
Save ksky/288744 to your computer and use it in GitHub Desktop.
gtalk echo bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('jivesoftware:smack:3.0.4') | |
@Grab('jivesoftware:smackx:3.0.4') | |
import org.jivesoftware.smack.* | |
(username, password) = ['<<from_username>>', '<<from_password>>'] | |
to = '<<to_username>>@gmail.com' | |
con = new XMPPConnection( | |
new ConnectionConfiguration('talk.google.com', 5222, 'gmail.com')) | |
con.connect() | |
con.login(username, password) | |
chat = con.chatManager.createChat(to, { chat, msg -> | |
chat.sendMessage(msg.body) | |
} as MessageListener) | |
chat.sendMessage("Say something to me. I'll echo it.") | |
while(true) { sleep 1000 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment