]> bicyclesonthemoon.info Git - ott/enhance/commitdiff
Two everythings are ready!
authorb <b@0d794883-4e4e-4f65-aa7a-0e7f5947bab5>
Sun, 19 Jan 2014 18:42:51 +0000 (18:42 +0000)
committerb <b@0d794883-4e4e-4f65-aa7a-0e7f5947bab5>
Sun, 19 Jan 2014 18:42:51 +0000 (18:42 +0000)
git-svn-id: svn://botcastle1b/npb@27 0d794883-4e4e-4f65-aa7a-0e7f5947bab5

403
403.htm
npbd
npbd.cpp

diff --git a/403 b/403
index 5a5a1bb1a5911ce5a50cba74cb8de15fb281d8a9..06ca40e69db44091e5cc00e7c962ab6f752bbfa5 100755 (executable)
Binary files a/403 and b/403 differ
diff --git a/403.htm b/403.htm
index a55525182668584013f9d8b2c69097f0f2a626a3..bfae310277a67d74d7962db563205172711010d4 100644 (file)
--- a/403.htm
+++ b/403.htm
@@ -1,12 +1,12 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
 <html lang="pl">
        <head>
-               <title>It's NewpixbOTTification time!</title>
+               <title>It's 403fication time!</title>
                        <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
        </head>
        <body>
                <a href="/"><img src="/img/botmlogo2.png" alt="1190.bicyclesonthemoon.dnsd.info" border="0"></a>
-               <h1>It's 403ification time!</h1>
+               <h1>It's 403fication time!</h1>
                <form method="get" action="/cgi/npb/npbd/403">
                        403 by URL<br>
                        URL of image:
diff --git a/npbd b/npbd
index 7d3edec7aad615c59de63fd25e70fc816c6a606b..b2f68dd7df785adf12b582ea66ee3873336c02ff 100755 (executable)
Binary files a/npbd and b/npbd differ
index 4f4e38f5eadaf96b24c9a7d9ef2a72faaaf9dfe8..6130131d6e1a6f431dd710893226f4dec64fbd88 100644 (file)
--- a/npbd.cpp
+++ b/npbd.cpp
@@ -1,5 +1,5 @@
-    //  //Download images and add
-   //  // Newpixbots to them!
+//  //  //Download images and add
+   //  // Newpixbots to them! (or Megans)
   //  //  
  //  //   Requires cgilib
 //  //  //line 146 of cgi.h
 #include <cgi.h>
 #include <stdio.h>
 #include <stdlib.h>
-//#include <strings.h>
 #include <unistd.h>
+#include <string.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 
-#define WGET_PATH "/usr/bin/wget"
-#define NPB_PATH  "./npb"
-#define RM_PATH   "/bin/rm"
-#define LOG_PATH  "/var/log/npb/npb.log"
-#define USERAGENT "NewpixbOTTification\x20(1190.bicyclesonthemoon.dnsd.info/npb/npb.htm)"
+#define WGET_PATH  "/usr/bin/wget"
+#define NPB_PATH   "./npb"
+#define MEG_PATH   "./403"
+#define RM_PATH    "/bin/rm"
+#define LOG_PATH   "/var/log/npb/npb.log"
+#define LOG_PATH2  "/var/log/npb/403.log"
+#define USERAGENT  "NewpixbOTTification\x20(1190.bicyclesonthemoon.dnsd.info/npb/npb.htm)"
+#define USERAGENT2 "403fication\x20(1190.bicyclesonthemoon.dnsd.info/npb/403.htm)"
+#define MSTD_PATH  "/pro/npb/mpb.png"
+#define MSTD_PATH2 "/pro/npb/503.png"
 
 int main (int argc, char *argv[]);
 void mustard(int mustard);
@@ -38,11 +43,19 @@ struct stat st;
 unsigned long p;
 unsigned short q;
 char **up;
+bool meg=false;
 
 int main (int argc, char *argv[])
 {
        cgi=cgiInit();
        
+       sprintf(path,"%s",(getenv("PATH_INFO")!=NULL)?(getenv("PATH_INFO")):"");
+       if(strcmp(path,"/403")==0)
+       {
+               meg=true;
+               //mustard(0);
+       }
+       
        up=cgiGetFiles(cgi);
        if (up)
        {
@@ -58,7 +71,7 @@ int main (int argc, char *argv[])
                sub=fork();
                if(sub==0)
                {
-                       t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",USERAGENT,"-O",path,url,(char *)0);
+                       t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",meg?USERAGENT2:USERAGENT,"-O",path,url,(char *)0);
                        exit(t);
                }
                waitpid(sub,&t,0);
@@ -68,7 +81,7 @@ int main (int argc, char *argv[])
        sub=fork();
        if(sub==0)
        {
-               t=execl(NPB_PATH,NPB_PATH,path,path,"q",(char *)0);
+               t=execl(meg?MEG_PATH:NPB_PATH,meg?MEG_PATH:NPB_PATH,path,path,"q",(char *)0);
                exit(t);
        }
        waitpid(sub,&t,0);
@@ -102,7 +115,7 @@ void mustard(int mustard)
 {
        if(mustard)
        {
-               cgiRedirect("/pro/npb/mpb.png");
+               cgiRedirect(meg?MSTD_PATH2:MSTD_PATH);
        }
        sub=fork();
        if(sub==0)
@@ -111,7 +124,7 @@ void mustard(int mustard)
                exit(t);
        }
        waitpid(sub,&t,0);
-       pix=fopen(LOG_PATH,"at");
+       pix=fopen(meg?LOG_PATH2:LOG_PATH,"at");
        if(pix!=NULL)
        {
                fprintf(pix,"%x %s\n",mustard,url);