вторник, 10 января 2012 г.

sendxmpp

apt-get install sendxmpp
/home/user/.sendxmpprc
#############################################
user@jabber.ru:5222 passwd
- - - - - - - - - - или - - - - - - - - - - - - - - - -
username: USER
jserver: 192.168.0.111:5222
component: localhost
password: PASS
#############################################
sudo chmod 600 /home/user/.sendxmpprc
----------------------------------------------------------------------------------
echo "tekst" | sendxmpp -s "tema" -r "zagolovok" -i user2@jabber.ru


----------------------------------------------------------------------------------
  apt install python-xmpp
  nano send.py
----------------------------------------------------------------------------------
#!/usr/bin/env python

import xmpp
from os import sys as sys

username = '$USER'
passwd = '$PASSWD'
file_name = sys.argv[1]
to = sys.argv[2]

file = open(file_name,'r')

msg = file.read()

client = xmpp.Client('localhost',debug=[])
client.connect(server=('1.1.1.1',5222))
client.auth(username, passwd, '$PASSWD')
client.sendInitPresence()
message = xmpp.Message(to, msg)
message.setAttr('type', 'chat')
client.send(message)
----------------------------------------------------------------------
echo "hi" > /tmp/send_x && python /py/send.py /tmp/send_x USER2@localhost

Комментариев нет:

Отправить комментарий

h265.sh

#!/bin/bash file="../mp4" if [ -d $file ]; then         echo "  Директория существует :-) "         for i in *.mp4; do f...