This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Script to access logs

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
a
antiemp
Voice
Posts: 2
Joined: Wed Feb 29, 2012 11:05 am

Script to access logs

Post by antiemp »

If this already exists, please point me in the right direction.

We currently keep all logs for a certain channel. We would like to have those logs accessible by the users. Two things need to happen.

1) Expose logs via http
2) Access logs via bot commands

For 1) we could simply point our http server to the logs folder and serve the files directly. If there are other solutions to this that are better, please advise.

For 2), we would like the following skeleton command:
!logs <date>

The <date> could be precise or fuzzy. Here are some examples:
!logs 2012-01-23
!logs Jan 23
!logs yesterday
!logs 1 week ago

Starting with precise dates should be easier for initial implementation, fuzziness can be added later.

The command would alert the bot, the bot would process the date and return an URL to the appropriate log file via private or public message to the user inputting the command.

If something like this already exists, please advise.

Thank you for your patience in reading this.
a
antiemp
Voice
Posts: 2
Joined: Wed Feb 29, 2012 11:05 am

Post by antiemp »

http://sourceforge.net/projects/logs2html/ seems to handle problem 1)

now just needing to look into problem 2)

also need to add problem 3) which is:
user should be able to request parts of a log to be private messaged

for example:
!logs <date> <last|first> <number>

so if user sends
!logs 2011-01-23 last 5

bot returns the last 5 lines spoken from the log file, with settings for max lines returnable and a default

if default line count is 15, then to get last 15 lines the user would send
!logs 2011-01-23 last

it would be nice to also allow the user to omit the date and have today set as the default
!logs last
would return the last 15 (default) lines of today's log
Post Reply