You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Martin Dosch ae19493f59 Merge branch 'sendxmpp-compatibility' into 'master'
Sendxmpp compatibility

See merge request mdosch-guest/go-sendxmpp!2
6 years ago
.gitignore Initial commit 6 years ago
LICENSE Added MIT LICENSE which I wanted to choose in the first place. 6 years ago
README.md Sendxmpp compatibility 6 years ago
go-sendxmpp.go Sendxmpp compatibility 6 years ago

README.md

go-sendxmpp

about

A little tool to send messages to an XMPP contact or MUC inspired by (but not as powerful as) sendxmpp.

requirements

installation

If you have GOPATH set just run this commands:

$ go get salsa.debian.org/mdosch-guest/go-sendxmpp
$ go install salsa.debian.org/mdosch-guest/go-sendxmpp

You will find the binary in $GOPATH/bin or, if set, $GOBIN.

usage

You can either pipe a programs output to go-sendxmpp or write in your terminal (put ^D in a new line to finish).

The account data is expected at ~/.sendxmpprc if no other configuration file location is specified with -f or --file. The configuration file is expected to be in the following format:

username: <your_username>
jserver: <jabber_server>
port: <jabber_port>
password: <your_jabber_password>

If no configuration file is present or if the values should be overridden it is possible to define the account details via command line options:

./go-sendxmpp --help
Usage: go-sendxmpp [-cdtx] [-f value] [--help] [-j value] [-p value] [-r value] [-u value] [parameters ...]
 -c, --chatroom    Send message to a chatroom.
 -d, --debug       Show debugging info.
 -f, --file=value  Set configuration file. (Default: ~/.sendxmppr)
     --help        Show help.
 -j, --jserver=value
                   XMPP server address.
 -p, --password=value
                   Password for XMPP account.
 -r, --resource=value
                   Set resource. When sending to a chatroom this is used as
                   'alias'. (Default: go-sendxmpp)
 -t, --tls         Use TLS.
 -u, --username=value
                   Username for XMPP account.
 -x, --start-tls   Use StartTLS.

examples

Send a message to two recipients using a configuration file.

cat message.txt | ./go-sendxmpp -f ./sendxmpp recipient1@example.com recipient2@example.com

Send a message to two recipients directly defining account credentials.

cat message.txt | ./go-sendxmpp -u bob@example.com -j example.com -p swordfish recipient1@example.com recipient2@example.com

Send a message to two groupchats (-c) using a configuration file.

cat message.txt | ./go-sendxmpp -cf ./sendxmpp chat1@conference.example.com chat2@conference.example.com