Commit e3aba31f authored by dimonov's avatar dimonov

Initial commit

parents
This hexchat plugin graphs your IRC network.
Requirements:
1. networkx
2. pydot
3. matplotlib
4. hexchat or xchat
Using on an xchat:
1. sed -i 's/hex/x/g' *.py
Loading the module:
1. Vim edit gr.py, change "#test" to your channel.
2. On hexchat, /py load gr.py
Run the graph:
1. At your console, with $DISPLAY predefined, python open.py
Compatibility with robots:
1. With a few subtle modifications the script can be executed by a robot.
import hexchat
import networkx as nx
from networkx.drawing.nx_pydot import write_dot
__module_name__ = "IRC Graph"
__module_version__ = "0.0.9"
__module_description__ = "Graph your IRC network"
ctx = hexchat.find_context(channel="#test")
g = nx.Graph()
def privmsgd(word, word_eol, userdata=None):
for u in ctx.get_list("users"):
if (u.nick in word[3:]):
g.add_edge(word[0].split("!")[0].replace(":", ""), u.nick)
write_dot(g, "irc.dot")
return hexchat.EAT_NONE
hexchat.hook_server("PRIVMSG", privmsgd)
import networkx as nx
from networkx.drawing.nx_pydot import read_dot
import matplotlib.pyplot as plt
g = read_dot("irc.dot")
plt.subplot()
nx.draw(g, with_label=True, font_weight='bold')
plt.show()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment