excid3 / logbot Goto Github PK
View Code? Open in Web Editor NEWA minimal IRC bot for logging channels
Home Page: http://excid3.com/blog/projects/logbot
License: GNU General Public License v2.0
A minimal IRC bot for logging channels
Home Page: http://excid3.com/blog/projects/logbot
License: GNU General Public License v2.0
Can you add topic changes, mode changes, parts, and quits? :P
and nick changes
What else happens in a channel?
/notice
and
(And add in the nickserv stuff so i don't have to rehard code it in :P)
(And oper would be cool too, but 99% of people wouldn't use that xP)
When there is a link in an IRC channel being logged, it is not a hyperlink in the logs themselves.
I am attempting to use the bot with the rather unusually configured server irc.mindfang.org:6667
The server has a rule where all clients must use the string "pcc31" as their USER name.
Example server message showing this: :[email protected] PRIVMSG #The_Former_SBARG_Players :<c=254,124,39>PK: Who are you</c>
As I am unable to change my nickname and USER name separately, the bot is forced to use the non-descriptive nickname of "pcc31" to be able to connect. Please make it possible to change the bot's USER name.
I was wondering it you plan on supporting username and SSL support for the bot ? If your not going to can you update the irclib with the latest and i'll fork it and add in those.
Thanks.
Currently you have to edit the logbot.py file to change settings. As a result, you can't easily run multiple instances of the same script.
It would be nice if the script only used the current constants as defaults, and allowed for a config file to be passed as a commandline argument that would override the defaults.
I wouldn't mind implementing this myself, but as I'm new to Python and don't really know what the config file standard is (YAML, JSON, ini, etc?), maybe we could discuss it in this ticket. :)
Traceback (most recent call last):
File "logbot.py", line 351, in
main()
File "logbot.py", line 344, in main
bot.start()
File "/home/zachthibeau/logbot/ircbot.py", line 247, in start
SimpleIRCClient.start(self)
File "/home/zachthibeau/logbot/irclib.py", line 1114, in start
self.ircobj.process_forever()
File "/home/zachthibeau/logbot/irclib.py", line 229, in process_forever
self.process_once(timeout)
File "/home/zachthibeau/logbot/irclib.py", line 214, in process_once
self.process_data(i)
File "/home/zachthibeau/logbot/irclib.py", line 183, in process_data
c.process_data()
File "/home/zachthibeau/logbot/irclib.py", line 581, in process_data
self._handle_event(Event(command, prefix, target, [m]))
File "/home/zachthibeau/logbot/irclib.py", line 604, in _handle_event
self.irclibobj._handle_event(self, event)
File "/home/zachthibeau/logbot/irclib.py", line 325, in _handle_event
if handler[1](connection, event) == "NO MORE":
File "/home/zachthibeau/logbot/irclib.py", line 1049, in _dispatcher
getattr(self, m)(c, e)
File "logbot.py", line 312, in on_pubmsg
self.write_event("pubmsg", e)
File "logbot.py", line 212, in write_event
self.ftp.storbinary("STOR %s" % remote_fname, open(full_fname, "rb"))
File "/usr/lib/python2.7/ftplib.py", line 460, in storbinary
self.voidcmd('TYPE I')
File "/usr/lib/python2.7/ftplib.py", line 249, in voidcmd
return self.voidresp()
File "/usr/lib/python2.7/ftplib.py", line 224, in voidresp
resp = self.getresp()
File "/usr/lib/python2.7/ftplib.py", line 217, in getresp
raise error_temp, resp
ftplib.error_temp: 421 Timeout - try typing a little faster next time
this is from the bot I have connected to freenode, the other seperate bot is connected to another irc and hasn't timed out on the ftp uploads.
If you create an empty directory for logs by hand, and then point the bot to it, it crashes. I think it only checks if the directory exists, then tries to access non-existing files(i.e. logs/index.html).
Our dependency is getting pretty old and could use a significant update to handle all the new functionality in https://bitbucket.org/jaraco/irc/src
Related #22
Traceback (most recent call last):
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\logbot.py", line 357, in
main()
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\logbot.py", line 350, in main
bot.start()
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\ircbot.py", line 247, in start
SimpleIRCClient.start(self)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 1114, in start
self.ircobj.process_forever()
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 229, in process_forever
self.process_once(timeout)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 214, in process_once
self.process_data(i)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 183, in process_data
c.process_data()
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 581, in process_data
self._handle_event(Event(command, prefix, target, [m]))
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 604, in _handle_event
self.irclibobj._handle_event(self, event)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 325, in _handle_event
if handler[1](connection, event) == "NO MORE":
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\irclib.py", line 1049, in _dispatcher
getattr(self, m)(c, e)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\logbot.py", line 315, in on_pubmsg
self.write_event("pubmsg", e)
File "C:\Documents and Settings\HP_Administrator\Desktop\logbot\excid\excid3-logbot-925df20\logbot.py", line 212, in write_event
self.ftp.storbinary("STOR %s" % remote_fname, open(full_fname, "rb"))
File "C:\Python27\lib\ftplib.py", line 453, in storbinary
self.voidcmd('TYPE I')
File "C:\Python27\lib\ftplib.py", line 249, in voidcmd
return self.voidresp()
File "C:\Python27\lib\ftplib.py", line 224, in voidresp
resp = self.getresp()
File "C:\Python27\lib\ftplib.py", line 210, in getresp
resp = self.getmultiline()
File "C:\Python27\lib\ftplib.py", line 196, in getmultiline
line = self.getline()
File "C:\Python27\lib\ftplib.py", line 183, in getline
line = self.file.readline()
File "C:\Python27\lib\socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
well the bot goes to add that day's log to the index file it just rewrites the whole file rather than just added that day's file. It also rewrites the main index file. for a example look at logs.geek-crack.com
Not sure if this qualifies here, even if it does, it's a minor issue. More of a suggestion I think.
If a channel directory(logs/#channel/) does not exist, the bot creates the directory and appends a link with the name of the channel to the main index.html file("Logged Channels").
Now, if you remove only the channel directory by hand, the bot will create it, and append the link to the main index.html as usual, even though one already exists there.
Might be a good idea to check the logs on startup, maybe recreate the main index.html file based on existing logs/ subdirectories.
I would like some way of automatically creating separate index pages on a monthly basis, instead of ending up with a long list of hundreds of logs per year. I can't think of an easy way of implementing this though.
So far I've had to manually edit the index page (check http://logs.kag2d.nl/%23kag/index.html for an example)
The log folder location should be configurable and not be forced to be in the current directory that the logbot resides in.
I'd like to use logbot for an internal IRC server at work but the channels we have setup require a key, is there quick modification that can be made so logbot can support this?
Thanks,
Tim
Once the bot reaches the amount of messages where it's supposed to upload the logs it will get stuck on "Uploading to FTP..." until doing ctrl+c and then it will connect to the FTP and upload. I would appreciate if this could get looked into.
currently there is no way to add a password for the username used by the bot. this required for the ability to send PMs to individuals.
Ok, as you asked for on freenode:
Repair the ability to log /parts
Add ability to log nickchanges
Show nick!user@host in /joins and /parts
Someone in channel says @help, bot gives them link defined in file. I.E. I say @help. Botlogger says: Hi! I'm a log bot made by excid3. The logs for this bot can be found at: (uri defined in file)
make @help customizable, I.e, can be set to #help or !help
And, as previously mentioned by someone, creates html indexes of the folders. I.e. in the folder logs, it creates index.html, which has links to the folders within logs. AND within folder #chan, it creates index.html which links to all the files in there. Files should be listed in anti-chronological order, meaning today is always at the top, and the bots first day of use is at the bottom
Strip ASCII color codes or replace them with HTML colors, mainly because this is pretty "ugly":
[21:00:51] <TESTBOT> �[37m[�[31mTEST VF�[37m] - �[35mhTESTBOT TEST �[37m[TEST AGAIN]
Kudos for your hard work though, that piece of code is awesome.
So when someone joins a channel as a registered channel founder operator on PolNet(irc.ircnet.pl) (might be network-specific), while the bot is already there, I get this:
File "logbot.py", line 113, in on_mode
modes, person = e.arguments()
ValueError: too many values to unpack
Full output here: http://pastebin.com/0VJJJERL.
Any way to fix it? Would be nice, since I find this bot very useful.
When the FTP server closes the connection due to idleness the bot crashes and stops logging. See the following traceback.
Uploading to FTP...
Traceback (most recent call last):
File "logbot.py", line 350, in
main()
File "logbot.py", line 343, in main
bot.start()
File "/home/daniel/src/logbot/ircbot.py", line 247, in start
SimpleIRCClient.start(self)
File "/home/daniel/src/logbot/irclib.py", line 1114, in start
self.ircobj.process_forever()
File "/home/daniel/src/logbot/irclib.py", line 229, in process_forever
self.process_once(timeout)
File "/home/daniel/src/logbot/irclib.py", line 214, in process_once
self.process_data(i)
File "/home/daniel/src/logbot/irclib.py", line 183, in process_data
c.process_data()
File "/home/daniel/src/logbot/irclib.py", line 600, in process_data
self._handle_event(Event(command, prefix, target, arguments))
File "/home/daniel/src/logbot/irclib.py", line 604, in _handle_event
self.irclibobj._handle_event(self, event)
File "/home/daniel/src/logbot/irclib.py", line 325, in _handle_event
if handler[1](connection, event) == "NO MORE":
File "/home/daniel/src/logbot/irclib.py", line 1049, in _dispatcher
getattr(self, m)(c, e)
File "logbot.py", line 282, in on_join
self.write_event("join", e)
File "logbot.py", line 211, in write_event
self.ftp.storbinary("STOR %s" % remote_fname, open(full_fname, "rb"))
File "/usr/lib64/python2.7/ftplib.py", line 453, in storbinary
self.voidcmd('TYPE I')
File "/usr/lib64/python2.7/ftplib.py", line 249, in voidcmd
return self.voidresp()
File "/usr/lib64/python2.7/ftplib.py", line 224, in voidresp
resp = self.getresp()
File "/usr/lib64/python2.7/ftplib.py", line 217, in getresp
raise error_temp, resp
ftplib.error_temp: 421 No transfer timeout (600 seconds): closing control connection
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.