Wildfire on windows and to have some command line options

I want to install a Wildlife Server on Windows platform…Is it possible to have command line accessto the server?..can I send a message through command line or run a .bat file which would send a message to all the IM clients?

Any help would really be appreciated

Thanks

Hi veens,

that’‘s an interesting question, maybe there is a hidden feature but I think there’'s none available.

“wget.exe” or “curl.exe” could make broadcasting possible …

Would perl be an option for you? There are some XMPP modules available and also a simple script to do the login and post would be much easier to write. The cmd commands are very limited.

LG

using standard Perl without XMPP which supports only ASCII (7 bit, no €, á, à , …):

#!perl.exe

#my $version = ‘‘v0.01’’;

use strict;

use warnings;

use IO::Socket;

use IO::Handle;

$|=1;

my $message = (defined($ARGV[0]))?"@ARGV":"";

my ($buf, $buflen, $buf2);

  1. adjust this

my $my_servername = “jabber.org”;

my $my_adminport = “9090”;

my $my_adminpath = “”; # ‘‘Wifi/’’ if you are using Tomcat and ‘‘Wifi.war’’, don’‘t forget the trailing ‘’/’’

my $my_adminuser = “admin”;

my $my_password = “private”;

my $baseurl = “http://” . $my_servername . “:” . $my_adminport . “/” . $my_adminpath;

my $loginpage = “login.jsp”;

my $broadcastpage = “user-message.jsp”;

my $TRGT_PROTO = ‘‘tcp’’;

my $HTTP_HEADER = "Host: " . $my_servername . “:” . $my_adminport . “\r\n” .

“Content-Type: application/x-www-form-urlencoded\r\n” .

“Connection: close\r\n” .

“Content-Type: text/html; charset=UTF-8\r\n\r\n”;

my $cookie = “”;

  1. login - POST and GET are possible, we will use POST

#printf("############# login #############\n");

$buf = “url=/” . $my_adminpath . $broadcastpage . “&”;

$buf .= “login=true” . “&”;

$buf .= “username=” . $my_adminuser . “&”;

$buf .= “password=” . $my_password;

$buflen=length($buf);

$buf = “POST " . $baseurl . $loginpage . " HTTP/1.0\r\n” .

"Content-Length: " . length($buf) . “\r\n” .

$HTTP_HEADER .

$buf;

&send();

&get_cookie();

#printf("############# sending broadcast #############\n");

$message =~ s/%/%25/g;

$message =~ s/+/%2b/g;

$message =~ s/&/%26/g;

$buf = “tabs=true” . “&”;

$buf .= “send=true” . “&”;

$buf .= “message=” . $message;

$buflen=length($buf);

$buf = “POST " . $baseurl . $broadcastpage . " HTTP/1.0\r\n” .

"Content-Length: " . length($buf) . “\r\n” .

$cookie . “\r\n” .

$HTTP_HEADER .

$buf;

&send();

#printf("############# success ? #############\n");

if ($buf2 =~ /$broadcastpage?success=true/)

{

printf(“OK\n”);

} else

{

printf(“Error\n”);

exit(3);

};

exit(0);

sub get_cookie()

{

if ($buf2 =~ /(Cookie\s**:\s***;)/)

{

$cookie = $1;

} else

{

printf(“Could not get Cookie / Login”);

exit(1);

};

#printf("############# Cookie: %s\n", $cookie);

};

sub send()

{

#printf("############# Send: %s\n", $buf);

my $sock = new IO::Socket::INET->new(PeerAddr => $my_servername,

PeerPort => $my_adminport, Proto => $TRGT_PROTO);

if (!defined $sock)

{

printf(“Could not create socket.\n”);

exit(2);

};

$sock->send($buf);

$buf = “”;

$buf2 = “”;

while (<$sock>)

{

read($sock, $buf, 1000);

$buf2 .= $buf;

};

close ($sock);

#printf("############# Recv: %s\n", $buf2);

};

/codesave it as ‘‘bc.pl’’ and call it with ‘‘bc.pl “My 1st Broadcast Message: Hello!!1!”’’

Hi LG,

Thanks for your prompt reply…Do I need to store bc.pl in the bin folder of the server or just in the Wildfire folder??

Thanks,

Veena

Hi Veena,

you may store it whereever you like, also on a remote computer which can access the admin console. So the Wifi directory could be a bad location for it as it may be deleted during an update.

LG

Hi LG,

As suggested I have stored bc.pl in C drive on my local machine and the wildfire server is installed on shop-01 server…when I try to run bc.pl “Hello” from command line on my local machine it opens the bc.pl file in notepad.

My wildfire server is running and I have 3 clients Miranda, GAIM and Psi connected to the Wildfire Server as 3 different users.

Thanks,

Veena

Hi Veena,

you need to install Perl, you may download it here: http://www.activestate.com/Products/ActivePerl/

I can’‘t provide a script which runs fine only using Windows build-in “shell” commands and I’'m quite sure that this is impossible.

If you have already installed Perl and the file associations are missing try to right-click it and “Open with …, Choose Program …” and select perl.exe.

LG

Hey LG,

Thanks a lot for your help…It is somewhat the feature I am looking at…Is it possible send a private message to 3 to 4 people on my contact list instead of broadcasting to everyone using the bc.pl file…If you could guide me on the changes I would really appreciate it.

Thanks,

Veena

Hi Veena,

can you wait for JM-184 Individual/Group Broadcast to be implemented? I see no way to access the admin console (port 9090) to send a message to a single person.

Smack would be the much better way if you want to customize this much more. This should also run very fine as a command line version, but it allocates so much memory to send a single message.

LG

Hi LG,

Thanks for your update…How long before JM-184 will be available? I am fairly new to Smack so I was wondering if you could guide me to some documentation or some codes I can look at before diving into it?

Thanks,

Veena

Hi Veena,

1-2 weeks for 2.6.0 which should include it.

Smack has a very detailed documentation with some examples. It shouldn’'t be hard but it will take some time to write what you need. Examples how to login are also in the Smack forum.

LG