From: b Date: Mon, 30 Dec 2013 18:08:36 +0000 (+0000) Subject: Interface! The results are for me only! X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=38ef8122700cb58186e0c031ba1d23a685ffecb8;p=ott%2Fenhance Interface! The results are for me only! git-svn-id: svn://botcastle1b/npb@18 0d794883-4e4e-4f65-aa7a-0e7f5947bab5 --- diff --git a/makefile b/makefile index 255abba..34ab114 100644 --- a/makefile +++ b/makefile @@ -9,4 +9,4 @@ npb: npb.cpp makefile $(CC) $(CF) $(LF) -o npb npb.cpp npbd: npb npbd.cpp makefile - $(CC) $(CF) -o npbd npbd.cpp + $(CC) $(CF) -o npbd npbd.cpp $(LF2) diff --git a/npb b/npb index 8b76126..f39f1b1 100755 Binary files a/npb and b/npb differ diff --git a/npb.cpp b/npb.cpp index 10f41f0..a08e577 100644 --- a/npb.cpp +++ b/npb.cpp @@ -1,8 +1,11 @@ - // // It's NewpixbOTTification Time! - // // Take a picture and add a newpixbot to it! - // // Requires Dev Image Library, on Pentium III libdevil must be recompiled with --disable-ssl2 --disable-ssl3 - // // -// // ~~bicyclesonthemoon + // //It's NewpixbOTTification Time! + // // Take a picture and add a newpixbot to it! + // // + // // Requires Dev Image Library, +// // //on Pentium III libdevil must be + // // recompiled with --disable-ssl2 --disable-ssl3 + // // + // // ~~bicyclesonthemoon #define INPIX_MUSTARD 1 #define OUTPIX_MUSTARD 2 diff --git a/npbd b/npbd index 947d9d0..acaa15d 100755 Binary files a/npbd and b/npbd differ diff --git a/npbd.cpp b/npbd.cpp index 920b154..831d80b 100644 --- a/npbd.cpp +++ b/npbd.cpp @@ -1,6 +1,68 @@ + // //Download images and add + // // Newpixbots to them! + // // + // // Requires cgilib +// // //line 146 of cgi.h + // // must be changed + // // from "extern }" + // // to "}" +// // // + // // ~~bicyclesonthemoon + +#include #include +#include +#include + +#define WGET_PATH "/usr/bin/wget" +#define NPB_PATH "./npb" + +int main (int argc, char *argv[]); int main (int argc, char *argv[]) { - printf("Content-type: text/html\n\nIt's NewpixbOTTification time!

It's NewpixbOTTification time!\n"); + FILE *pix; + char url[1024]; + char path[256]; + //char cmd[1024]; + s_cgi *cgi; + int t; + pid_t sub; + + cgi=cgiInit(); + sprintf(url,"%s",cgiGetValue(cgi,"inpix")); + sprintf(path,"/var/tmp/%lu",(unsigned long)getpid()); + + + //Why is there no spawnl() in linux? + sub=fork(); + if(sub==0) + { + t=execl(WGET_PATH,WGET_PATH,"-q","-O",path,url,(char *)0); + return t; + } + waitpid(sub,&t,0); + if(t)return t; + + sub=fork(); + if(sub==0) + { + t=execl(NPB_PATH,NPB_PATH,path,path,"q",(char *)0); + return t; + } + waitpid(sub,&t,0); + + printf("Content-type: text/html\n\n"); + printf("It's NewpixbOTTification time!"); + printf("

It's NewpixbOTTification time!

"); + printf("%s
",path); + printf("%s
",url); + printf("%d
",t); + printf("%lu
",(unsigned long)sub); + printf("\n"); + + + + //npbpix=fopen("/var/tmp/test","wb"); + //fclose(npbpix); return 0; } \ No newline at end of file