Can anyone give me an idea of how to grab the topic of a channel on a given irc server (no passwords or nickserv to deal with)

thanks

    Use sockets. You'll basically be building an IRC bot that logs onto the server, joins a channel, and drops back out

      I was in class and we were finishing up so I couldn't elaborate:

      you'll want to use socket functions to create a connection to the IRC server, then send raw IRC commands to join the channel or grab the topic (I don't know if /TOPIC is supported universally or not) but then you'd parse the raw buffer output for "topic on #channel is:" and strip from there out to the end character (possibly a Set by: statement or something) and then return that into a local variable and close your socket.

      you'll want to use fsockopen, fwrite/fread, and fclose for the socket functionality. good luck! post any questions back here - I've written IRC bots in PHP before with full functionality, albeit a long time ago. 😉

        As a side note, there are probably pre-made PHP classes that interact with IRC, so you'd just have to find one and figure out how it works.

          Yeah, I remember I used something called moloBot as a guide for my IRC bot (i think it was from codewalkers, but I don't remember)

            Write a Reply...