<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[xmpppy - All your code are belong to us]]></title><description><![CDATA[Thoughts, stories and ideas on code and technology in general.<br>Blog title inspired by <a href="https://en.wikipedia.org/wiki/All_your_base_are_belong_to_us" target="_blank">this meme</a>]]></description><link>https://allurcode.com/</link><image><url>https://allurcode.com/favicon.png</url><title>xmpppy - All your code are belong to us</title><link>https://allurcode.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Tue, 09 Jun 2026 05:24:22 GMT</lastBuildDate><atom:link href="https://allurcode.com/tag/xmpppy/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Install xmpppy on CentOS]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>xmpppy is a Python library allowing you to send messages from your server to any Jabber enabled communicator.<br>
Firstly download and unpack <a href="http://xmpppy.sourceforge.net/">xmpppy</a> to a local directory. Next go into the unpacked directory and run:</p>
<pre><code class="language-bash">python setup.py install
</code></pre>
<p>Next you need a script that will do the sending. Use</p>]]></description><link>https://allurcode.com/install-xmpppy-on-centos/</link><guid isPermaLink="false">5b7b0aa2b52b43084c9ea113</guid><category><![CDATA[bash]]></category><category><![CDATA[jabber]]></category><category><![CDATA[Linux]]></category><category><![CDATA[xmpppy]]></category><dc:creator><![CDATA[Wojtek]]></dc:creator><pubDate>Thu, 23 Apr 2009 17:27:01 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>xmpppy is a Python library allowing you to send messages from your server to any Jabber enabled communicator.<br>
Firstly download and unpack <a href="http://xmpppy.sourceforge.net/">xmpppy</a> to a local directory. Next go into the unpacked directory and run:</p>
<pre><code class="language-bash">python setup.py install
</code></pre>
<p>Next you need a script that will do the sending. Use your favourite text editor to create file i.e.:</p>
<pre><code class="language-bash">vim xsend.py
</code></pre>
<p>Just paste below script which was taken from original site. Create another jabber account that you&#x2019;ll send messages from and remember to change values in line 20 to those new login details.</p>
<pre><code class="language-python">#!/usr/bin/python
# $Id: xsend.py,v 1.8 2006/10/06 12:30:42 normanr Exp $ 
import sys,os,xmpp,time
if len(sys.argv) &lt; 2:
    print &quot;Syntax: xsend JID text&quot;
    sys.exit(0)

tojid=sys.argv[1]
text=&apos; &apos;.join(sys.argv[2:])

jidparams={}
if os.access(os.environ[&apos;HOME&apos;]+&apos;/.xsend&apos;,os.R_OK):
    for ln in open(os.environ[&apos;HOME&apos;]+&apos;/.xsend&apos;).readlines():
        if not ln[0] in (&apos;#&apos;,&apos;;&apos;):
            key,val=ln.strip().split(&apos;=&apos;,1)
            jidparams[key.lower()]=val
for mandatory in [&apos;jid&apos;,&apos;password&apos;]:
    if mandatory not in jidparams.keys():
        open(os.environ[&apos;HOME&apos;]+&apos;/.xsend&apos;,&apos;w&apos;).write(&apos;#Uncomment fields before use and type in correct credentials.\n#JID=romeo@montague.net/resource (/resource is optional)\n#PASSWORD=juliet\n&apos;)
        print &apos;Please point ~/.xsend config file to valid JID for sending messages.&apos;
        sys.exit(0)

jid=xmpp.protocol.JID(jidparams[&apos;jid&apos;])
cl=xmpp.Client(jid.getDomain(),debug=[])

con=cl.connect()
if not con:
    print &apos;could not connect!&apos;
    sys.exit()
print &apos;connected with&apos;,con
auth=cl.auth(jid.getNode(),jidparams[&apos;password&apos;],resource=jid.getResource())
if not auth:
    print &apos;could not authenticate!&apos;
    sys.exit()
print &apos;authenticated using&apos;,auth

#cl.SendInitPresence(requestRoster=0)   # you may need to uncomment this for old server
id=cl.send(xmpp.protocol.Message(tojid,text))
print &apos;sent message with id&apos;,id

time.sleep(1)   # some older servers will not send the message if you disconnect immediately after sending

#cl.disconnect()
</code></pre>
<p>All you need to do now is to run the script &#x1F642; First run will create a file in your home directory which should contain username and password from line 20. Second run should accually send the message.</p>
<pre><code class="language-bash">./xsend.py your_main_jabber@your_jabber.com Hello world!
</code></pre>
<p>Now set up your monitoring scripts that will send you jabber messages when something goes wrong.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>