IRC Topic Reply Mod

Started by dtm.exe, April 22, 2005, 10:47:25 PM

Previous topic - Next topic

dtm.exe

I was in Team CompLexity's IRC channel (#compLexity on GameSurge) and I noticed that everytime someone would post a new topic or reply to a topic on their forums, it would notify everyone in the IRC channel and give them a link along with a description.

Quote<compLexity> : New Reply to Post! By NoKk :
<compLexity> : Link: http://www.complexityclan.com/forums/viewtopic.php?t=5090&start=15#94187 :
<compLexity> : Message: lol... :

I realize that they are using phpBB, but maybe someone could make a mod that would mimic what this phpBB mod does?  Or maybe it's just a program that monitors forum activity?  Thanks.

-Dan The Man

TLM

#1
I already did this, it's much easier than you think....
1)Setup an eggdrop, get it working.
2)Download the rssnews.tcl script from, http://perplexa.net/development/
3)Enable RSS news on the forum
4)Use a url something like this for the RSS data, http://www.somedomain.com/forums/index.php?type=rss;action=.xml
5)Set the POSTNEWS var to 1
6)Make sure you rehash/restart the bot

Then when someone posts, it will be top on the RSS data and the bot checks RSS at some interval (10 mins, can be changed), and then if new ones are on the data, it would then do a public message.

If you want to take a look at what I have done before you try, #teamplayfirst@Gamesurge or #teamplayfirst@QuakeNET, this will only occur when Atlantian is online, my eggdrops are not on a perminate host yet, still shopping for one.

dtm.exe

OK...

1) How do I setup an eggdrop?
2) What do I do with this script?
3) How do I set POSTNEWS to 1?

-Dan The Man

TLM

Be prepared for a very steep learning curve.

First just a website host wont do, you need access to a linux box (aka shell host), or use a windrop.  A windrop is same thing as an eggdrop but it has been modifyed to run under windows.

http://www.egghelp.org/setup.htm - should cover basic eggdrop setup,
After going thru that, get the bot in the right channel.

Once that looks good, download the script then you have to modify the script to your liking, meaning just edit the first page or so where variables are set and such.  When setting the variables per feed, make sure you set POSTNEWS to 1 in the script.

After configuring the script, go back to eggdrop config and go all the way to bottom and add source scripts/rssnews.tcl, obviously correcting the file name as needed.

dtm.exe


TLM

http://www.simplemachines.org/community/index.php?topic=27269.msg244206#msg244206

Oh yeah, shows another meathod, again involving an eggdrop.  That version is for 1.0 to 1.0.3 of SMF.

Kirby

Eggdrops are really friendly people, especially with the MySQL extension. I made a "snooper" TCL script for that that makes somewhat of a who's chatting area.

TLM

Quote from: Kirby on April 25, 2005, 09:36:06 PM
Eggdrops are really friendly people, especially with the MySQL extension. I made a "snooper" TCL script for that that makes somewhat of a who's chatting area.
Yeah? I just started playing with the mysql module some.
Could you explain that script a little more? Your 8 words are kinda vauge, it sounds interesting and I might want to duplicate if its what I am thinking...

Kirby


# MySQL database name
set database "my database"

# MySQL host
set host "localhost"

# MySQL username
set user "my username"

# MySQL password
set pass "my password"

# Now lets connect to MySQL!
mysql_connect $database $host $user $pass

bind topc - * updateTopic
proc updateTopic {nick userhost handle channel topic} {
set escapedTopic [mysql_escape $topic]
mysql_query "UPDATE smf_snooper_etc SET value = '$escapedTopic' WHERE variable = 'topic';"
}
bind join - * gotJoin
proc gotJoin {nick uhost hand chan} {
set escapedNick [mysql_escape $nick]
mysql_query "INSERT INTO smf_snooper_users (memberName, logTime) VALUES ('$escapedNick', UNIX_TIMESTAMP());"
}
bind nick - * gotNick
proc gotNick {nick uhost hand chan newnick} {
set escapedNick [mysql_escape $nick]
set escapedNewNick [mysql_escape $newnick]
mysql_query "UPDATE smf_snooper_users SET memberName = '$escapedNewNick' WHERE memberName = '$escapedNick';"
}
bind kick - * gotKick
proc gotKick {nick uhost hand chan target reason} {
set escapedTarget [mysql_escape $target]
mysql_query "DELETE FROM smf_snooper_users WHERE memberName = '$escapedTarget';"
}
bind sign - * gotPart
bind part - * gotPart
proc gotPart {nick uhost hand chan reason} {
set escapedNick [mysql_escape $nick]
mysql_query "DELETE FROM smf_snooper_users WHERE memberName = '$escapedNick';"
}
bind evnt - save reSnoop
proc reSnoop {type} {
mysql_query "DELETE FROM smf_snooper_users;"
foreach nickname [chanlist #zfgc] {
set escapedNick [mysql_escape $nickname]
mysql_query "INSERT INTO smf_snooper_users (memberName, logTime) VALUES ('$escapedNick', UNIX_TIMESTAMP());"
}
}


We call it the "snooper". There are two tables in the database, smf_snooper_etc and smf_snooper_users. snooper_etc functions like the settings table, a variable and a value. smf_users contains all of the users who were on, the log time, thier status (not in the snooper script I pasted here, but I do have it somewhere - I just need to find it), and is actively updated. It also escapes single quotes with a slash, so that it doesn't cause problems.

Also, typing .save in a DCC session with the eggdrop saves and rehashes the botuser file as well as refreshes the snooper info.

TLM

I know its a little delayed but that might be interesting to work off of for my forums to mess with.
*gears start turning in mind....*

Miraenda

Just ensure you are on a dedicated server if you plan to run eggdrop or that you get confirmation from your webhost that you can run it.  Run it on a shared server without authorization/confirmation, and your webhost will likely either a) chown the folder to root with 000 file permissions and notify you, or b) suspend your account.

TLM

Accualy I run the eggdrop from my home network server, but the webhost allows outside access to the sql dbase if you set it up that way in my case.  Most webhosts dont give you shell access to start such a bot, but it may be possible via means of a php script maybe, but why as long as I can access the DB server directly.

redline

how can you do it with only new topics ?

TLM

Umm probly using the sa=news instead of sa=recent in the rss path.

Have not tested this though.

Advertisement: