Did anybody know command line tool for message send that allows to automatic send reminder, notice, etc for jabber-users? Cross platform on perl?
Hi,
if you have some java coding experience you may want to take some minutes and write your own one using the Smack API.
LG
Thanks for idea. I do not have java experience, but there is my “Hello, world!”
import org.jivesoftware.smack.*;
public class simple {
public static void main (String[] args) {
try {
XMPPConnection connection = new XMPPConnection(“aMyServerIP”);
connection.login(“aUser”, “aPassword”);
connection.createChat(“aReciver”).sendMessage(“Be wild or be dead”);
}
catch (XMPPException e) {
e.printStackTrace();
}
}
}
Wow! The message is coming! But what is run-time exceptions???
D:\temp\SMACK>java -classpath “C:\Program Files\Java\jre1.5.0_06”;D:\temp\SMACK\smack.jar;. simple
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.ServiceDiscovery
anager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.XHTMLManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.muc.MultiUserCha
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.filetransfer.Fil
TransferManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.ServiceDiscovery
anager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.XHTMLManager
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.muc.MultiUserCha
Error! A startup class specified in smack-config.xml could not be loaded: org.jivesoftware.smackx.filetransfer.Fil
TransferManager
Hi,
you may want to add all three(?) smack*.jar files to the classpath.
LG
Thats right!
Hey guys,
Some time ago I came across some posts about console clients. A quick google search revealed http://cjc.jajcus.net/trac/ and JabberX but the later seems to be no longer under development.
Regards,
– Gato
I put together the following hack. I think it will do what you want. Please keep in mind that this is my first java program, so don’'t laugh too hard.
Tommy
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
public class XMPPCast {
private static XMPPConnection connection;
private static Chat chat;
private static String server;
private static String user;
private static String pswd;
private static String sendto;
private static String testmsg;
private static String server_flag = “-s”;
private static String from_flag = “-f”;
private static String password_flag = “-p”;
private static String to_flag = “-t”;
private static String message_flag = “-m”;
public static void main(String[] args) {
if(args.length == 0){
ShowUSAGE();
return;
}
for (int i = 0; i userid");
System.out.println(" -t Identifies the userid to send the message to");
System.out.println(" -m A quoted string containing the message");
System.out.println(" ");
}
}
/code
Message was edited by: tommyt
Thanks for example.
Hi Tommy,
it’'s really quick and dirty and for this purpose just fine (;
Could you please edit your post and put the code into a … section like
import foobar;
args[i] = “-s”;
int i = 0 * 3;
/code
as the forum did convert to < italic > and thus the program will fail if one copies it, so it looks like
import foobar;
args[i] = “-s”;
int i = 0 * 3;
/i
LG