5 #include "httpclient.h"
7 /* $ModDep: httpclient.h */
9 class MyModule : public Module
12 MyModule(InspIRCd* Me)
21 virtual void Implements(char* List)
23 List[I_OnRequest] = List[I_OnUserJoin] = List[I_OnUserPart] = 1;
26 virtual Version GetVersion()
28 return Version(1,0,0,1,VF_VENDOR,API_VERSION);
31 virtual void OnUserJoin(userrec* user, chanrec* channel)
33 // method called when a user joins a channel
35 std::string chan = channel->name;
36 std::string nick = user->nick;
37 // ServerInstance->Log(DEBUG,"User " + nick + " joined " + chan);
39 Module* target = ServerInstance->FindModule("m_http_client.so");
41 HTTPClientRequest req(ServerInstance, this, target, "http://znc.in/~psychon");
45 ServerInstance->Log(DEBUG,"module not found, load it!!");
48 char* OnRequest(Request* req)
50 HTTPClientResponse* resp = (HTTPClientResponse*)req;
51 if(!strcmp(resp->GetId(), HTTP_CLIENT_RESPONSE))
53 ServerInstance->Log(DEBUG, resp->GetData());
58 virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage)
64 class MyModuleFactory : public ModuleFactory
75 virtual Module * CreateModule(InspIRCd* Me)
77 return new MyModule(Me);
82 extern "C" void * init_module( void )
84 return new MyModuleFactory;