Home > dpaste, FOSS, Fun, GTK, Python, xchat > My first XChat plugin :)

My first XChat plugin :)

Recently I started using IRC a lot. As I was doing some django, PyQT and KDE/C++ development. Yes, its lot of development. And then whenever I want to ask some question on IRC, I have to use pastebin/dpaste. ( dpaste is developed upon django framework. :) ). Now, to dpaste any code, I have to switch to Firefox, I have to use mouse as well. I have to copy paste the link to xchat. This was tedious task for me. So, I started making a plugin for xchat so that I could easily paste my code. Fortunately XChat has python plugin interface.

This plugin runs with the command:

/dpaste language

If you keep <language> empty, it will assume it to be “Plain”. You can use any language supported by dpaste.com. The command will open a gtk window, in which you can paste your code. And then “dpaste” button will copy paste the link (containing your code) on your xchat input box. :) . As of now I am sure, it works fine in IITK proxy system. I am pretty much sure it will work fine if you are behind no proxy.

Before using the proxy, you will need to change few parameters in the script, namely “proxy_username”, “proxy_password”, “proxy_server”, “proxy_port”. If you are not behind proxy, just keep “proxy_server” empty.

Also, you should install python module “ClientForm”, “pygtk”, and “urllib2″.

aptitude install python-clientform python python-gtk2

To load the script, a simple way is /load <path to plugin file> . Or you can copy the script in ~/.xchat2 folder. That way the script will be loaded whenever you open xchat.

You can download the code from here. As of now I haven’t made docs, but its an easy plugin, and some commenting as well. :)

Updates : Download the plugin version 0.6, and you don’t need to change anything in it. The plugin uses xchat proxy settings by itself. :)   As of now, http proxy and no proxy is supported.
http://rohitj.net/myscripts/xchat_plugin_dpaste

Categories: dpaste, FOSS, Fun, GTK, Python, xchat Tags:
  1. mark
    August 14th, 2008 at 16:16 | #1

    Can you please check the link or the file? It doesn’t work anymore! thx!

  2. August 15th, 2008 at 07:44 | #2

    Hello Mark,
    The link is working fine. If you open the link, there is a file (http://rohitj.net/myscripts/xchat_plugin_dpaste/xchat-dpaste-0.6.1.py) which you need to download. If you still find problem, let me know.

  1. No trackbacks yet.