1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 #include "httpclient.h"
20 /* $ModDep: httpclient.h */
22 class MyModule : public Module
27 MyModule(InspIRCd* Me)
30 Implementation eventlist[] = { I_OnRequest, I_OnUserJoin, I_OnUserPart };
31 ServerInstance->Modules->Attach(eventlist, this, 3);
39 virtual Version GetVersion()
41 return Version(1,0,0,1,VF_VENDOR,API_VERSION);
44 virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
46 // method called when a user joins a channel
48 std::string chan = channel->name;
49 std::string nick = user->nick;
50 ServerInstance->Log(DEBUG,"User " + nick + " joined " + chan);
52 Module* target = ServerInstance->Modules->Find("m_http_client.so");
55 HTTPClientRequest req(ServerInstance, this, target, "http://znc.in/~psychon");
59 ServerInstance->Log(DEBUG,"module not found, load it!!");
62 virtual const char* OnRequest(Request* req)
64 HTTPClientResponse* resp = (HTTPClientResponse*)req;
65 if(!strcmp(resp->GetId(), HTTP_CLIENT_RESPONSE))
67 ServerInstance->Log(DEBUG, resp->GetData());
72 virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)