The Python client allows you to easily send errors either via HTTP or email. The Python client can be used independently, or as part of a greater implementation. Quick example:
from arecibo import post
arecibo = post()
arecibo.set("account", "yourpublicaccountnumber")
arecibo.set("status", "403")
arecibo.set("url", "http://badapp.org")
arecibo.send()
It can be checked out of SVN at:
svn co http://arecibo.svn.beanstalkapp.com/clients/trunk/python/
Tested on Python 2.4 and 2.5, however any 2.x version of Python is likely to be sufficient. If using the http client, permission to make a HTTP post to the Arecibo server is needed. If using the email client, an smtp server that can be communicated with is needed.
If the default smtp communication in Arecibo is insufficient, then the library can be easily wrapped to use another mailing method. See the Plone or Django clients for an example.
The only value set automatically is server, which we set to the output of socket.gethostname().
You can send via http or email by changing the value of transport. You can also set the from and server variables. For example (where arecibo is the object as above):
arecibo.transport = "smtp" arecibo.smtp_server = "localhost" arecibo.smtp_from = "noreply@atmyhost.com"
To prevent timeouts, the library does change the socket timeout value, sends the HTTP request and then instantly sets it back to the original value. This should minimize the impact on any other socket connections. With Python 2.6, this will be changed when new functionality is available.
All the sample clients are in SVN, if you create your own client, please let us know.