0

I have one mIRC Bot running on an IRC network. I was wondering if there is any way to "listen" to HTTP requests etc via sockets or any other method. What I mean by that is, say I have another forum, and whenever someone posts a new topic on this forum, then I want the bot to announce on channel that someone has made a new post. Some such similar events, like when someone logs in to forum, or when someone loads a particular webpage, can it be made so that sending some http request (or another connection method that can be obtained from within PHP). Basically I want a some page like '' sendmsg.php?msg=Message '' and that should make bot post that message. I would think we'll need to keep some socket open for listening or so, but I couldn't find relevant answers for it in my searches.

Hrishikesh
  • 1,076
  • 1
  • 8
  • 22

1 Answers1

0

You can have your bot listen on a given port. In order to open the listening port you'd use /socklisten. In order for this to work, the port you are listening on would have to be exposed to the internet or whichever network your php script would be running from (meaning, no firewalls blocking and possibly forwarded in the router).

In order to handle any incomming connections you'd need a on socklisten event. If all you want to do is send a message or otherwise small piece of information then your best bet is probably to invent your own protocol. This can be as simple as reading the data sent and returning a OK message, use a php socket to write data. Otherwise you would have to implement a serverside for whichever protocol you are expecting the message in. E.g. HTTP.

rvalvik
  • 1,559
  • 11
  • 15