From: b Date: Sat, 24 Sep 2022 17:40:37 +0000 (+0000) Subject: Converted some more files for new config tool. X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=410fcc2105bd5ff048287ca6e65c179ef505dd4b;p=ott%2Fmirror Converted some more files for new config tool. --- diff --git a/bot2.1.cpp b/bot2.1.cpp index 9cb99f7..225179b 100644 --- a/bot2.1.cpp +++ b/bot2.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// bot2.cpp (bothasar_t) +// Copyright (C) 2014, 2022 Balthasar Szczepański +// bot2.cpp (bothasar_t) automatically generated from bot2.1.cpp // the mirror bot. -// 12.09.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -32,39 +32,39 @@ #define LINE_LIMIT 16000 -###USERAGENT2 +// ###C_USERAGENT_2: #define USERAGENT "bothasar_t (http://1190.bicyclesonthemoon.info/ott/; Time thread mirror bot)" -###ICT_ADDRESS -###OTT_ADDRESS -###FORA_ADDRESS +// ###C_ICT_ADDRESS: #define ICT_ADDRESS "http://forums.xkcd.com/viewforum.php?f=7" +// ###C_OTT_ADDRESS: #define OTT_ADDRESS "http://forums.xkcd.com/viewtopic.php?f=7&t=101043&start=" +// ###C_FORA_ADDRESS: #define FORA_ADDRESS "http://forums.xkcd.com" -###LAST_PATH -###LOG_PATH -###NP_PATH -###NP_PATH_1 -###NP_PATH_2 -###NP_PATH_3 -###STOP_PATH -###LIST_PATH -###SIG_PATH -###INF_PATH -###UP_PATH -###IND_PATH -###TOP_PATH -###END_PATH -###AV_PATH -###ATT_PATH -###IMG_PATH -###LAST_PAGE +// ###C_LAST_PATH: #define LAST_PATH "/eizm/mem/ottmirror/lasttime." +// ###C_LOG_PATH_2: #define LOG_PATH "/eizm/log/ottmirror/bot2.log." +// ###C_NP_PATH_0: #define NP_PATH "/eizm/tmp/ottmirror/np.p0." +// ###C_NP_PATH_1: #define NP_PATH_1 "/eizm/tmp/ottmirror/np.p1." +// ###C_NP_PATH_2: #define NP_PATH_2 "/eizm/tmp/ottmirror/np.p2." +// ###C_NP_PATH_3: #define NP_PATH_3 "/eizm/tmp/ottmirror/np.p3." +// ###C_STOP_PATH: #define STOP_PATH "/eizm/tmp/ottmirror/fullstop." +// ###C_LIST_PATH: #define LIST_PATH "/eizm/www/time/ott/postlist/" +// ###C_SIG_PATH: #define SIG_PATH "/eizm/www/time/ott/sig/" +// ###C_INF_PATH: #define INF_PATH "/eizm/www/time/ott/otterinf/" +// ###C_UP_PATH: #define UP_PATH "/eizm/www/time/ott/np/" +// ###C_IND_PATH: #define IND_PATH "/eizm/www/time/ott/ottfront" +// ###C_TOP_PATH: #define TOP_PATH "/eizm/www/time/ott/top" +// ###C_END_PATH: #define END_PATH "/eizm/www/time/ott/end" +// ###C_AV_PATH: #define AV_PATH "/eizm/www/time/ott/avatar/" +// ###C_ATT_PATH: #define ATT_PATH "/eizm/www/time/ott/attachment/" +// ###C_IMG_PATH: #define IMG_PATH "/eizm/www/time/ott/image/" +// ###C_LAST_PAGE: #define LAST_PAGE "/eizm/www/time/ott/np/last" -###WGET_PATH -###MAWK_PATH -###RM_PATH -###AWK_LATEST -###AWK_LIST -###AWK_BOT2 -###AWK_UPLOAD -###AWK_INDEX +// ###C_WGET_PATH: #define WGET_PATH "/usr/bin/wget" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_AWK_LATEST: #define AWK_LATEST "/eizm/pro/ottmirror/findlatest.awk" +// ###C_AWK_LIST: #define AWK_LIST "/eizm/pro/ottmirror/list.awk" +// ###C_AWK_BOT2: #define AWK_BOT2 "/eizm/pro/ottmirror/bot2.awk" +// ###C_AWK_UPLOAD: #define AWK_UPLOAD "/eizm/pro/ottmirror/upload.awk" +// ###C_AWK_INDEX: #define AWK_INDEX "/eizm/pro/ottmirror/index.awk" FILE *cwfile; FILE *stopfile; diff --git a/bot3.1.cpp b/bot3.1.cpp index bc66d54..f6f406d 100644 --- a/bot3.1.cpp +++ b/bot3.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// bot3.cpp (bothasar_p) +// Copyright (C) 2014, 2022 Balthasar Szczepański +// bot3.cpp (bothasar_p) automatically generated from bot3.1.cpp // the post bot. -// 12.09.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -32,28 +32,28 @@ #define STOP_MSTD 4 #define NAME_MSTD 5 -###USERAGENT3 -###NAME_PATH -###LASTTIME_PATH -###LOG_PATH3 -###TEMPFILE_PATH -###POSTDATA_PATH -###COOKIE_PATH -###STOP_PATH3 -###POST_PATH3 -###LIST_PATH3 -###LAST_PATH3 -###IND_PATH3 -###OK_PATH3 -###PM_PATH3 -###FAIL_PATH3 +// ###C_USERAGENT_3: #define USERAGENT "bothasar_p (http://1190.bicyclesonthemoon.info/ott/; Time thread post bot)" +// ###C_NAME_PATH: #define NAME_PATH "/eizm/mem/ottmirror/name" +// ###C_LASTTM_PATH_3: #define LASTTIME_PATH "/eizm/mem/ottmirror/bot3last" +// ###C_LOG_PATH_3: #define LOG_PATH "/eizm/log/ottmirror/bot3.log" +// ###C_TEMPFILE_PATH_3: #define TEMPFILE_PATH "/eizm/tmp/ottmirror/bot3temp" +// ###C_POSTDATA_PATH_3: #define POSTDATA_PATH "/eizm/tmp/ottmirror/bot3post" +// ###C_COOKIE_PATH_3: #define COOKIE_PATH "/eizm/tmp/ottmirror/bot3cook" +// ###C_STOP_PATH_3: #define STOP_PATH "/eizm/tmp/ottmirror/bot3stop" +// ###C_POST_PATH_3: #define POST_PATH "/eizm/mem/ottmirror/mpost/" +// ###C_LIST_PATH_3: #define LIST_PATH "/eizm/mem/ottmirror/mlist/" +// ###C_LAST_PATH_3: #define LAST_PATH "/eizm/mem/ottmirror/mlist/last" +// ###C_IND_PATH_3: #define IND_PATH "/eizm/www/time/ott/mfront" +// ###C_OK_PATH_3: #define OK_PATH "/eizm/mem/ottmirror/mpost/ok/" +// ###C_PM_PATH_3: #define PM_PATH "/eizm/mem/ottmirror/mpost/pm/" +// ###C_FAIL_PATH_3: #define FAIL_PATH "/eizm/mem/ottmirror/mpost/fail/" -###WGET_PATH -###MAWK_PATH -###RM_PATH -###MV_PATH -###AWK_POST -###AWK_PM +// ###C_WGET_PATH: #define WGET_PATH "/usr/bin/wget" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_MV_PATH: #define MV_PATH "/bin/mv" +// ###C_AWK_POST: #define AWK_POST "/eizm/pro/ottmirror/post.awk" +// ###C_AWK_PM: #define AWK_PM "/eizm/pro/ottmirror/pm.awk" FILE *cwfile; FILE *stopfile; diff --git a/findpost.1.cpp b/findpost.1.cpp index 22d33d3..8392549 100644 --- a/findpost.1.cpp +++ b/findpost.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// findpost.cpp +// Copyright (C) 2014, 2022 Balthasar Szczepański +// findpost.cpp automatically generated from findpost.1.cpp // find a post by ID. -// 12.09.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -19,7 +19,7 @@ // You should have received a copy of the GNU Affreo General Public License // along with OTT mirror. If not, see . -###POSTLIST_PATH +// ###C_LIST_PATH: #define LIST_PATH "/eizm/www/time/ott/postlist/" #include @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) for(short i=31;i>=0;--i) { pagenumber2 = pagenumber + (1L << i); - sprintf(path,"%s%lu",POSTLIST_PATH,pagenumber2); + sprintf(path,"%s%lu",LIST_PATH,pagenumber2); file=fopen(path,"rt"); if(file==NULL) continue; @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) printf("0\n"); return 0; } - sprintf(path,"%s%lu",POSTLIST_PATH,pagenumber); + sprintf(path,"%s%lu",LIST_PATH,pagenumber); file=fopen(path,"rt"); if(file==NULL) { @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) } } fclose(file); - sprintf(path,"%s%lu",POSTLIST_PATH,pagenumber-1); + sprintf(path,"%s%lu",LIST_PATH,pagenumber-1); file=fopen(path,"rt"); if(file==NULL) { @@ -107,4 +107,4 @@ int main(int argc, char *argv[]) printf("0\n"); fclose(file); return 0; -} \ No newline at end of file +} diff --git a/index.1.awk b/index.1.awk index 3324b74..e66ad67 100644 --- a/index.1.awk +++ b/index.1.awk @@ -1,8 +1,8 @@ # OTT mirror -# Copyright (C) 2014, 2016 Balthasar Szczepański -# index.awk +# Copyright (C) 2014, 2016, 2022 Balthasar Szczepański +# index.awk automatically generated from index.1.awk # separate the topic from index page. -# 31.03.2016 +# 24.09.2022 # This file is part of OTT mirror. # @@ -35,7 +35,7 @@ BEGIN{ else if ($0 ~ /
  • #include -###RM_PATH -###CAT_PATH +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_CAT_PATH: #define CAT_PATH "/bin/cat" -###TOP_PATH -###OTTFRONT_PATH -###MFRONT_PATH -###END_PATH +// ###C_TOP_PATH: #define TOP_PATH "/eizm/www/time/ott/top" +// ###C_IND_PATH: #define IND_PATH "/eizm/www/time/ott/ottfront" +// ###C_IND_PATH_3_: #define IND_PATH_3 "/eizm/www/time/ott/mfront" +// ###C_END_PATH: #define END_PATH "/eizm/www/time/ott/end" int main() { @@ -56,7 +56,7 @@ int main() sub=fork(); if(sub==0) { - r=execl(CAT_PATH,CAT_PATH,OTTFRONT_PATH,(char *)0); + r=execl(CAT_PATH,CAT_PATH,IND_PATH,(char *)0); exit(r); } waitpid(sub,&r,0); @@ -67,7 +67,7 @@ int main() sub=fork(); if(sub==0) { - r=execl(CAT_PATH,CAT_PATH,MFRONT_PATH,(char *)0); + r=execl(CAT_PATH,CAT_PATH,IND_PATH_3,(char *)0); exit(r); } waitpid(sub,&r,0); diff --git a/makefile b/makefile index c708747..9542982 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ # Copyright (C) 2020 Balthasar Szczepański # "makefile" is automatically generated from "makefile.1.mak" # find the latest page and number of posts. -# 18.09.2020 +# 24.09.2022 # This file is part of OTT mirror. # @@ -41,20 +41,21 @@ RM = /usr/bin/rm CONFIGURE = /botm/bin/config/configure.pl CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE) -all: +# keep these lists in the same order!: +TO_GENERATE = bot2.awk bot2.cpp bot3.cpp findpost.cpp index.awk index.cpp mpview.cpp mview.cpp pm.awk post.awk post.cpp posted.cpp preview.awk +GENERATE_FROM = bot2.1.awk bot2.1.cpp bot3.1.cpp findpost.1.cpp index.1.awk index.1.cpp mpview.1.cpp mview.1.cpp pm.1.awk post.1.awk post.1.cpp posted.1.cpp preview.1.awk + +all: $(TO_GENERATE) makefile: makefile.1.mak $(CONFIGFILE) $(CONFIGURE_CMD) < makefile.1.mak > makefile -bot2.awk: bot2.1.awk $(CONFIGFILE) - $(CONFIGURE_CMD) < bot2.1.awk > bot2.awk - -bot2.cpp: bot2.1.cpp $(CONFIGFILE) - $(CONFIGURE_CMD) < bot2.1.cpp > bot2.cpp +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) + $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) clean: - $(RM) -f bot2.awk + $(RM) -f $(TO_GENERATE) PHONY: all clean diff --git a/makefile.1.mak b/makefile.1.mak index fe29f82..f244a65 100644 --- a/makefile.1.mak +++ b/makefile.1.mak @@ -2,7 +2,7 @@ # Copyright (C) 2020 Balthasar Szczepański # "makefile" is automatically generated from "makefile.1.mak" # find the latest page and number of posts. -# 18.09.2020 +# 24.09.2022 # This file is part of OTT mirror. # @@ -41,20 +41,21 @@ CONFIGFILE = settings-$(TARGET).txt settings.txt CONFIGURE = /botm/bin/config/configure.pl ###MAKE_CONFIGURE: CONFIGURE_CMD = $(PERL) $(CONFIGURE) $(CONFIGFILE) -all: +# keep these lists in the same order!: +TO_GENERATE = bot2.awk bot2.cpp bot3.cpp findpost.cpp index.awk index.cpp mpview.cpp mview.cpp pm.awk post.awk post.cpp posted.cpp preview.awk +GENERATE_FROM = bot2.1.awk bot2.1.cpp bot3.1.cpp findpost.1.cpp index.1.awk index.1.cpp mpview.1.cpp mview.1.cpp pm.1.awk post.1.awk post.1.cpp posted.1.cpp preview.1.awk + +all: $(TO_GENERATE) makefile: makefile.1.mak $(CONFIGFILE) $(CONFIGURE_CMD) < makefile.1.mak > makefile -bot2.awk: bot2.1.awk $(CONFIGFILE) - $(CONFIGURE_CMD) < bot2.1.awk > bot2.awk - -bot2.cpp: bot2.1.cpp $(CONFIGFILE) - $(CONFIGURE_CMD) < bot2.1.cpp > bot2.cpp +$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) + $(CONFIGURE_CMD) --in $(GENERATE_FROM) --out $(TO_GENERATE) clean: - $(RM) -f bot2.awk + $(RM) -f $(TO_GENERATE) PHONY: all clean diff --git a/mpview.1.cpp b/mpview.1.cpp index 44858a9..ebc69a1 100644 --- a/mpview.1.cpp +++ b/mpview.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// mpview.cpp +// Copyright (C) 2014, 2022 Balthasar Szczepański +// mpview.cpp automatically generated from mpview.1.cpp // view a post from the mirror. -// 02.09.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -25,23 +25,23 @@ #include #include -###RM_PATH -###CAT_PATH -###MAWK_PATH +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_CAT_PATH: #define CAT_PATH "/bin/cat" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" -###NP_TOP_PATH -###NP_END_PATH -###INFO_PATH -###POST_PATH3 -###OK_PATH3 -###PM_PATH3 -###FAIL_PATH3 +// ###C_NP_TOP_PATH: #define NP_TOP_PATH "/eizm/www/time/ott/np/top" +// ###C_NP_END_PATH: #define NP_END_PATH "/eizm/www/time/ott/np/end" +// ###C_INFO_PATH: #define INFO_PATH "/eizm/www/time/ott/info.htm" +// ###C_POST_PATH_3: #define POST_PATH "/eizm/mem/ottmirror/mpost/" +// ###C_OK_PATH_3: #define OK_PATH "/eizm/mem/ottmirror/mpost/ok/" +// ###C_PM_PATH_3: #define PM_PATH "/eizm/mem/ottmirror/mpost/pm/" +// ###C_FAIL_PATH_3: #define FAIL_PATH "/eizm/mem/ottmirror/mpost/fail/" // ###POSTLIST_PATH3 // ###LAST_PATH3 -###AWK_VIEW -###AWK_MVIEW -###TEMP_PATHm +// ###C_AWK_VIEW: #define AWK_VIEW "/eizm/pro/ottmirror/view.awk" +// ###C_AWK_MVIEW: #define AWK_MVIEW "/eizm/pro/ottmirror/mview.awk" +// ###TEMP_PATHm int main() { diff --git a/mview.1.cpp b/mview.1.cpp index e36b050..71c9270 100644 --- a/mview.1.cpp +++ b/mview.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// mview.cpp +// Copyright (C) 2014, 2022 Balthasar Szczepański +// mview.cpp automatically generated from mview.1.cpp // view posts from the mirror. -// 12.09.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -25,20 +25,20 @@ #include #include -###RM_PATH -###CAT_PATH -###MAWK_PATH +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_CAT_PATH: #define CAT_PATH "/bin/cat" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" -###NP_TOP_PATH -###NP_END_PATH -###INFO_PATH -###POST_PATH3 -###POSTLIST_PATH3 -###LAST_PATH3 +// ###C_NP_TOP_PATH: #define NP_TOP_PATH "/eizm/www/time/ott/np/top" +// ###C_NP_END_PATH: #define NP_END_PATH "/eizm/www/time/ott/np/end" +// ###C_INFO_PATH: #define INFO_PATH "/eizm/www/time/ott/info.htm" +// ###C_POST_PATH_3: #define POST_PATH "/eizm/mem/ottmirror/mpost/" +// ###C_LIST_PATH_3: #define LIST_PATH "/eizm/mem/ottmirror/mlist/" +// ###C_LAST_PATH_3: #define LAST_PATH "/eizm/mem/ottmirror/mlist/last" -###AWK_VIEW -###AWK_MVIEW -###TEMP_PATH3v +// ###C_AWK_VIEW: AWK_VIEW "/eizm/pro/ottmirror/view.awk" +// ###C_AWK_MVIEW: AWK_MVIEW "/eizm/pro/ottmirror/mview.awk" +// ###TEMP_PATH3v unsigned long p2np(unsigned long p) { @@ -52,7 +52,7 @@ unsigned long p2np(unsigned long p) for(short i=31;i>=0;--i) { np2 = np + (1L << i); - sprintf(path,"%s%lu",POSTLIST_PATH,np2); + sprintf(path,"%s%lu",LIST_PATH,np2); file=fopen(path,"rt"); if(file==NULL) continue; @@ -66,7 +66,7 @@ unsigned long p2np(unsigned long p) } if(np==0) return 1L; - sprintf(path,"%s%lu",POSTLIST_PATH,np); + sprintf(path,"%s%lu",LIST_PATH,np); file=fopen(path,"rt"); if(file==NULL) return 1L; @@ -78,7 +78,7 @@ unsigned long p2np(unsigned long p) } fclose(file); --np; - sprintf(path,"%s%lu",POSTLIST_PATH,np); + sprintf(path,"%s%lu",LIST_PATH,np); file=fopen(path,"rt"); if(file==NULL) return 1L; @@ -214,7 +214,7 @@ int main() if(r) printf("

    Ch*rpin* M*stard

    "); - sprintf(path2,"%s%lu",POSTLIST_PATH,np); + sprintf(path2,"%s%lu",LIST_PATH,np); file=fopen(path2,"rt"); if(file!=NULL) { diff --git a/pm.1.awk b/pm.1.awk index cd6dc5a..9434e2d 100644 --- a/pm.1.awk +++ b/pm.1.awk @@ -1,163 +1,164 @@ -# OTT mirror -# Copyright (C) 2014 Balthasar Szczepański -# pm.awk -# send a PM. -# 12.09.2014 - -# This file is part of OTT mirror. -# -# OTT mirror is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affreo General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OTT mirror is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affreo General Public License for more details. -# -# You should have received a copy of the GNU Affreo General Public License -# along with OTT mirror. If not, see . - -BEGIN{ - FS="=" -###fora -###USERAGENT3a - prefix1="This%20is%20an%20automaticly%20generated%20message%20from%20the%20%5Burl%3D###own_url_encoded;%5D%D0%AFO%D0%AF%D0%AFIM%20TTO%5B%2Furl%5D.%0AYour%20post%20couldn%27t%20be%20posted.%0AThe%20%5Burl%3D###own_url_encoded;%2Flog%2Fbot3.log%5Dlog%5B%2Furl%5D%20may%20help%20you%20determine%20the%20reasons%20for%20this.%5Bquote%3D%22%5Bcolor%3D%230000FF%5D" - prefix2="%5B%2Fcolor%5D%22%5D" - postfix="%5B%2Fquote%5D%5Bright%5D%5Bsize%3D85%5D--%20posted%20by%20###bot3name_encoded;%5B%2Fsize%5D%5B%2Fright%5D" - OK=0 - MUSTARD=1 - INDELIVERABLE=2 -}; -{ - eq=index($0,"=") - argtab[substr($0,1,eq-1)]=substr($0,eq+1) -}; -END{ - if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login")) - { - print "Pre-login fail." - exit MUSTARD - } - while((getline cookie < cookiefile)>0) - { - if(cookie ~ /_sid/) - { - split(cookie,arr,"_sid[ \t]*") - SID=arr[2] - } - } - close(cookiefile) - print "username=" name "&password=" pass "&sid=" SID "&login=Login" > postfile - close(postfile) - if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\"")) - { - print "Login fail." - exit MUSTARD - } - - while((getline temp < tempfile)>0) - { - if (temp ~ /
    0) - { - if(temp ~ /name=\"form_token/) - #\"#" - { - split(temp,arr,"(value=\")|(\" ?/>)") - argtab["form_token"]=arr[2] - } - if(temp ~ /name=\"creation_time/) - #\"#" - { - split(temp,arr,"(value=\")|(\" ?/>)") - argtab["creation_time"]=arr[2] - } - if(temp ~ /name=\"address_list/) - #\"#" - { - split(temp,arr,"(address_list\[u\]\[)|(\]\")") - argtab["address_list"]=arr[2] - } - if (temp ~ /

    postfile - printf ("&subject=Mirrorpost%%20failed")>postfile - if("&addbbcode20" in argtab) - printf ("&addbbcode20=%s",argtab["addbbcode20"])>>postfile - printf ("&message=%s%s%%3A%%20%s%s%s%s",prefix1,argtab["timenumber"],argtab["subject"],prefix2,argtab["message"],postfix)>>postfile - printf ("&address_list%%5Bu%%5D%%5B%s%%5D=to",argtab["address_list"])>>postfile - printf ("&post=Submit")>postfile - if("disable_smilies" in argtab) - printf ("&disable_smilies=%s",argtab["disable_smilies"])>>postfile - if("disable_magic_url" in argtab) - printf ("&disable_magic_url=%s",argtab["disable_magic_url"])>>postfile - printf ("&creation_time=%s",argtab["creation_time"])>>postfile - printf ("&form_token=%s",argtab["form_token"])>>postfile - close(postfile) - - if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/ucp.php?i=pm&mode=compose&action=post\"")) - { - print "Submit fail." - exit MUSTARD - } - - while((getline temp < tempfile)>0) - { - if (temp ~ /

    information/) - { - success=1 - } - } - close(tempfile) - - if (success!=1) - { - print "Sent back to preview!" - exit INDELIVERABLE - } - - while((getline cookie < cookiefile)>0) - { - if(cookie ~ /_sid/) - { - split(cookie,arr,"_sid[ \t]*") - SID=arr[2] - break - } - } - close(cookiefile) - if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " cookiefile " \"" fora "/ucp.php?mode=logout&sid=" SID"\"")) - { - print "Logout fail." - } -} +# OTT mirror +# Copyright (C) 2014, 2022 Balthasar Szczepański +# pm.awk automatically generated from pm.1.awk +# send a PM. +# 24.09.2022 + +# This file is part of OTT mirror. +# +# OTT mirror is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affreo General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OTT mirror is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affreo General Public License for more details. +# +# You should have received a copy of the GNU Affreo General Public License +# along with OTT mirror. If not, see . + +BEGIN{ + FS="=" +###AWK_fora: fora="http://forums.xkcd.com" +###AWK_useragent_3: useragent="\"bothasar_p (http://1190.bicyclesonthemoon.info/ott/; Time thread post bot)\"" + + prefix1="This%20is%20an%20automaticly%20generated%20message%20from%20the%20%5Burl%3D###AWK_own_url_encoded;%5D%D0%AFO%D0%AF%D0%AFIM%20TTO%5B%2Furl%5D.%0AYour%20post%20couldn%27t%20be%20posted.%0AThe%20%5Burl%3D###AWK_own_url_encoded;%2Flog%2Fbot3.log%5Dlog%5B%2Furl%5D%20may%20help%20you%20determine%20the%20reasons%20for%20this.%5Bquote%3D%22%5Bcolor%3D%230000FF%5D" + prefix2="%5B%2Fcolor%5D%22%5D" + postfix="%5B%2Fquote%5D%5Bright%5D%5Bsize%3D85%5D--%20posted%20by%20###AWK_bot3name_encoded;%5B%2Fsize%5D%5B%2Fright%5D" + OK=0 + MUSTARD=1 + INDELIVERABLE=2 +}; +{ + eq=index($0,"=") + argtab[substr($0,1,eq-1)]=substr($0,eq+1) +}; +END{ + if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login")) + { + print "Pre-login fail." + exit MUSTARD + } + while((getline cookie < cookiefile)>0) + { + if(cookie ~ /_sid/) + { + split(cookie,arr,"_sid[ \t]*") + SID=arr[2] + } + } + close(cookiefile) + print "username=" name "&password=" pass "&sid=" SID "&login=Login" > postfile + close(postfile) + if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\"")) + { + print "Login fail." + exit MUSTARD + } + + while((getline temp < tempfile)>0) + { + if (temp ~ /

    0) + { + if(temp ~ /name=\"form_token/) + #\"#" + { + split(temp,arr,"(value=\")|(\" ?/>)") + argtab["form_token"]=arr[2] + } + if(temp ~ /name=\"creation_time/) + #\"#" + { + split(temp,arr,"(value=\")|(\" ?/>)") + argtab["creation_time"]=arr[2] + } + if(temp ~ /name=\"address_list/) + #\"#" + { + split(temp,arr,"(address_list\[u\]\[)|(\]\")") + argtab["address_list"]=arr[2] + } + if (temp ~ /

    postfile + printf ("&subject=Mirrorpost%%20failed")>postfile + if("&addbbcode20" in argtab) + printf ("&addbbcode20=%s",argtab["addbbcode20"])>>postfile + printf ("&message=%s%s%%3A%%20%s%s%s%s",prefix1,argtab["timenumber"],argtab["subject"],prefix2,argtab["message"],postfix)>>postfile + printf ("&address_list%%5Bu%%5D%%5B%s%%5D=to",argtab["address_list"])>>postfile + printf ("&post=Submit")>postfile + if("disable_smilies" in argtab) + printf ("&disable_smilies=%s",argtab["disable_smilies"])>>postfile + if("disable_magic_url" in argtab) + printf ("&disable_magic_url=%s",argtab["disable_magic_url"])>>postfile + printf ("&creation_time=%s",argtab["creation_time"])>>postfile + printf ("&form_token=%s",argtab["form_token"])>>postfile + close(postfile) + + if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/ucp.php?i=pm&mode=compose&action=post\"")) + { + print "Submit fail." + exit MUSTARD + } + + while((getline temp < tempfile)>0) + { + if (temp ~ /

    information/) + { + success=1 + } + } + close(tempfile) + + if (success!=1) + { + print "Sent back to preview!" + exit INDELIVERABLE + } + + while((getline cookie < cookiefile)>0) + { + if(cookie ~ /_sid/) + { + split(cookie,arr,"_sid[ \t]*") + SID=arr[2] + break + } + } + close(cookiefile) + if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " cookiefile " \"" fora "/ucp.php?mode=logout&sid=" SID"\"")) + { + print "Logout fail." + } +} diff --git a/post.1.awk b/post.1.awk index 1dee3c9..a6c23fb 100644 --- a/post.1.awk +++ b/post.1.awk @@ -1,208 +1,208 @@ -# OTT mirror -# Copyright (C) 2014 Balthasar Szczepański -# post.awk -# send a post. -# 20.03.2015 - -# This file is part of OTT mirror. -# -# OTT mirror is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affreo General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OTT mirror is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affreo General Public License for more details. -# -# You should have received a copy of the GNU Affreo General Public License -# along with OTT mirror. If not, see . - -BEGIN{ - FS="=" -###fora -###USERAGENT3a -}; -{ - eq=index($0,"=") - argtab[substr($0,1,eq-1)]=substr($0,eq+1) -}; -END{ - if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login")) - { - print "Pre-login fail." - exit 1 - } - while((getline cookie < cookiefile)>0) - { - if(cookie ~ /_sid/) - { - split(cookie,arr,"_sid[ \t]*") - SID=arr[2] - } - } - close(cookiefile) - print "username=" argtab["username"] "&password=" argtab["password"] "&sid=" SID "&login=Login" > postfile - close(postfile) - if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\"")) - { - print "Login fail." - exit 1 - } - - while((getline temp < tempfile)>0) - { - if (temp ~ /

    0) - { - if(temp ~ /name=\"form_token/) - #\"#" - { - temp=substr(temp, index(temp, "value=\"")+7) - temp=substr(temp, 1, index(temp, "\"")-1) - argtab["form_token"]=urlencode(entitydecode(temp)) - } - if(temp ~ /name=\"creation_time/) - #\"#" - { - temp=substr(temp, index(temp, "value=\"")+7) - temp=substr(temp, 1, index(temp, "\"")-1) - argtab["creation_time"]=urlencode(entitydecode(temp)) - } - if (tolower(temp) ~ /

    information/) - { - print "Unexpected h2: information\n" - getline temp < tempfile - print temp - exit 1 - } - } - close(tempfile) - - printf ("subject=%s",argtab["subject"])>postfile - if("&addbbcode20" in argtab) - printf ("&addbbcode20=%s",argtab["addbbcode20"])>>postfile - printf ("&message=%s",argtab["message"])>>postfile - printf ("&post=%s","Submit")>>postfile - if("disable_bbcode" in argtab) - printf ("&disable_bbcode=%s",argtab["disable_bbcode"])>>postfile - if("disable_smilies" in argtab) - printf ("&disable_smilies=%s",argtab["disable_smilies"])>>postfile - if("disable_magic_url" in argtab) - printf ("&disable_magic_url=%s",argtab["disable_magic_url"])>>postfile - if("attach_sig" in argtab) - printf ("&attach_sig=%s",argtab["attach_sig"])>>postfile - if("notify" in argtab) - printf ("¬ify=%s",argtab["notify"])>>postfile - printf ("&creation_time=%s",argtab["creation_time"])>>postfile - printf ("&form_token=%s",argtab["form_token"])>>postfile - close(postfile) - - system("sleep 1") - if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/posting.php?mode=reply&f=7&t=101043\"")) - { - print "Submit fail." - exit 1 - } - - while((getline temp < tempfile)>0) - { - if (temp ~ /

    information/) - { - success=1 - } - } - close(tempfile) - - if (success!=1) - { - print "Sent back to preview!" - exit INDELIVERABLE - } - - while((getline cookie < cookiefile)>0) - { - if(cookie ~ /_sid/) - { - split(cookie,arr,"_sid[ \t]*") - SID=arr[2] - break - } - } - close(cookiefile) - if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=logout&sid=" SID"\"")) - { - print "Logout fail." - } - - -} -function urlencode(name,all, len,iii,escaped,ch) -{ - len=length(name) - escaped="" - for(iii=1;iii<=len;++iii) - { - ch=substr(name,iii,1); - if ((ch ~ /[a-zA-Z0-9\.\-_~]/)&&(all=="")) - escaped = escaped ch - else - escaped = escaped "%" ch2hex[ch] - } - return escaped -}function entitydecode(ht ,i,j,un,num) -# quot, amp, lt, gt, nbsp, and decimal numbered. -{ - while ((i=match(ht, /&((#[0-9]+)|([a-zA-Z]+));/))!=0)# - { - un=un substr(ht, 1, i-1) - ht=substr(ht, i) - j=index(ht, ";") - - if(ht~/^&#/) - { - num=int(substr(ht, 3, j-3)) - un=un sprintf("%c",num) - } - else - { - num=tolower(substr(ht, 2, j-2)) - if(num == "quot") - un=un "\"" - else if(num == "amp") - un=un "&" - else if(num == "lt") - un=un "<" - else if(num == "gt") - un=un ">" - else if(num == "nbsp") - un=un "\xA0" - else - un = un ht - } - ht=substr(ht, j+1) - } - un=un ht - return un -} +# OTT mirror +# Copyright (C) 2014, 2015, 2022 Balthasar Szczepański +# post.awk automatically generated from post.1.awk +# send a post. +# 24.09.2022 + +# This file is part of OTT mirror. +# +# OTT mirror is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affreo General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OTT mirror is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affreo General Public License for more details. +# +# You should have received a copy of the GNU Affreo General Public License +# along with OTT mirror. If not, see . + +BEGIN{ + FS="=" +###AWK_fora: fora="http://forums.xkcd.com" +###AWK_useragent_3: useragent="\"bothasar_p (http://1190.bicyclesonthemoon.info/ott/; Time thread post bot)\"" +}; +{ + eq=index($0,"=") + argtab[substr($0,1,eq-1)]=substr($0,eq+1) +}; +END{ + if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " -U " useragent " -O " tempfile " " fora "/ucp.php?mode=login")) + { + print "Pre-login fail." + exit 1 + } + while((getline cookie < cookiefile)>0) + { + if(cookie ~ /_sid/) + { + split(cookie,arr,"_sid[ \t]*") + SID=arr[2] + } + } + close(cookiefile) + print "username=" argtab["username"] "&password=" argtab["password"] "&sid=" SID "&login=Login" > postfile + close(postfile) + if(system("wget -q -t 3 --connect-timeout=60 --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=login\"")) + { + print "Login fail." + exit 1 + } + + while((getline temp < tempfile)>0) + { + if (temp ~ /

    0) + { + if(temp ~ /name=\"form_token/) + #\"#" + { + temp=substr(temp, index(temp, "value=\"")+7) + temp=substr(temp, 1, index(temp, "\"")-1) + argtab["form_token"]=urlencode(entitydecode(temp)) + } + if(temp ~ /name=\"creation_time/) + #\"#" + { + temp=substr(temp, index(temp, "value=\"")+7) + temp=substr(temp, 1, index(temp, "\"")-1) + argtab["creation_time"]=urlencode(entitydecode(temp)) + } + if (tolower(temp) ~ /

    information/) + { + print "Unexpected h2: information\n" + getline temp < tempfile + print temp + exit 1 + } + } + close(tempfile) + + printf ("subject=%s",argtab["subject"])>postfile + if("&addbbcode20" in argtab) + printf ("&addbbcode20=%s",argtab["addbbcode20"])>>postfile + printf ("&message=%s",argtab["message"])>>postfile + printf ("&post=%s","Submit")>>postfile + if("disable_bbcode" in argtab) + printf ("&disable_bbcode=%s",argtab["disable_bbcode"])>>postfile + if("disable_smilies" in argtab) + printf ("&disable_smilies=%s",argtab["disable_smilies"])>>postfile + if("disable_magic_url" in argtab) + printf ("&disable_magic_url=%s",argtab["disable_magic_url"])>>postfile + if("attach_sig" in argtab) + printf ("&attach_sig=%s",argtab["attach_sig"])>>postfile + if("notify" in argtab) + printf ("¬ify=%s",argtab["notify"])>>postfile + printf ("&creation_time=%s",argtab["creation_time"])>>postfile + printf ("&form_token=%s",argtab["form_token"])>>postfile + close(postfile) + + system("sleep 1") + if(system("wget -q -t 3 --connect-timeout=60 --load-cookies=" cookiefile " --save-cookies=" cookiefile " --post-file=" postfile " -U " useragent " -O " tempfile " \""fora "/posting.php?mode=reply&f=7&t=101043\"")) + { + print "Submit fail." + exit 1 + } + + while((getline temp < tempfile)>0) + { + if (temp ~ /

    information/) + { + success=1 + } + } + close(tempfile) + + if (success!=1) + { + print "Sent back to preview!" + exit INDELIVERABLE + } + + while((getline cookie < cookiefile)>0) + { + if(cookie ~ /_sid/) + { + split(cookie,arr,"_sid[ \t]*") + SID=arr[2] + break + } + } + close(cookiefile) + if(system("wget -q -t 3 --connect-timeout=60 -U " useragent " -O " tempfile " \"" fora "/ucp.php?mode=logout&sid=" SID"\"")) + { + print "Logout fail." + } + + +} +function urlencode(name,all, len,iii,escaped,ch) +{ + len=length(name) + escaped="" + for(iii=1;iii<=len;++iii) + { + ch=substr(name,iii,1); + if ((ch ~ /[a-zA-Z0-9\.\-_~]/)&&(all=="")) + escaped = escaped ch + else + escaped = escaped "%" ch2hex[ch] + } + return escaped +}function entitydecode(ht ,i,j,un,num) +# quot, amp, lt, gt, nbsp, and decimal numbered. +{ + while ((i=match(ht, /&((#[0-9]+)|([a-zA-Z]+));/))!=0)# + { + un=un substr(ht, 1, i-1) + ht=substr(ht, i) + j=index(ht, ";") + + if(ht~/^&#/) + { + num=int(substr(ht, 3, j-3)) + un=un sprintf("%c",num) + } + else + { + num=tolower(substr(ht, 2, j-2)) + if(num == "quot") + un=un "\"" + else if(num == "amp") + un=un "&" + else if(num == "lt") + un=un "<" + else if(num == "gt") + un=un ">" + else if(num == "nbsp") + un=un "\xA0" + else + un = un ht + } + ht=substr(ht, j+1) + } + un=un ht + return un +} diff --git a/post.1.cpp b/post.1.cpp index 5c00d95..fd6aa8f 100644 --- a/post.1.cpp +++ b/post.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// post.cpp +// Copyright (C) 2014, 2022 Balthasar Szczepański +// post.cpp automatically generated from post.1.cpp // write posts from the mirror. -// 31.08.2015 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -27,23 +27,26 @@ #include #include -###RM_PATH -###MV_PATH -###CAT_PATH -###MAWK_PATH +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_MV_PATH: #define MV_PATH "/bin/mv" +// ###C_CAT_PATH: #define CAT_PATH "/bin/cat" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" -###POST_PATH -###INFO_PATH -###MPOST_PATH -###MLIST_PATH -###MLAST_PATH -###MFRONT_PATH +// ###C_POST_PATH: #define POST_PATH "/eizm/www/time/ott/post.htm" +// ###C_INFO_PATH: #define INFO_PATH "/eizm/www/time/ott/info.htm" +// ###C_MPOST_PATH: #define MPOST_PATH "/eizm/mem/ottmirror/mpost/" +// ###C_MLIST_PATH: #define MLIST_PATH "/eizm/mem/ottmirror/mlist/" +// ###C_MLAST_PATH: #define MLAST_PATH "/eizm/mem/ottmirror/mlist/last" +// ###C_MFRONT_PATH: #define MFRONT_PATH "/eizm/www/time/ott/mfront" -###AWK_PREVIEW -###AWK_VIEW -###TEMP_PATHp -###AWK_B2H -###AWK_VERIFY +// ###C_AWK_PREVIEW: AWK_PREVIEW "/eizm/pro/ottmirror/preview.awk" +// ###C_AWK_VIEW: AWK_VIEW "/eizm/pro/ottmirror/view.awk" +// ###TEMP_PATHp +// ###C_AWK_B2H: AWK_B2H "/eizm/pro/ottmirror/bb2html.awk" +// ###C_AWK_VERIFY: AWK_VERIFY "/eizm/pro/ottmirror/verify.awk" + +// ###C_BOT3NAME_ENCODED: #define BOT3NAME_ENCODED "bothasar_p" +// ###C_BOT3_URL: #define BOT3_URL "http://1190.bicyclesonthemoon.info/bothasar_p/" s_cgi *cgi; pid_t sub; @@ -356,7 +359,7 @@ void submit() for(unsigned long i=((lastpage>5)?(lastpage-2):1);i%lu, ",i,i); fprintf(tempfile,"%lu",lastpage,lastpage); - fprintf(tempfile,"\"Attachment(s)\" by bothasar_p » Sat Apr 05, 2014 9:40 pm UTC\n"); + fprintf(tempfile,"\"Attachment(s)\" by %s » Sat Apr 05, 2014 9:40 pm UTC\n", BOT3_URL, BOT3NAME_ENCODED); fprintf(tempfile,"

    %lu Replies
    \n",(unsigned long)((lastpage-1)*40+postslast)); fprintf(tempfile,"
    NaN Views
    \n"); fprintf(tempfile,"
    Last post by "); diff --git a/posted.1.cpp b/posted.1.cpp index 4b7792f..d531b16 100644 --- a/posted.1.cpp +++ b/posted.1.cpp @@ -1,8 +1,8 @@ // OTT mirror -// Copyright (C) 2014 Balthasar Szczepański -// posted.cpp +// Copyright (C) 2014, 2022 Balthasar Szczepański +// posted.cpp automatically generated from posted.1.cpp // posts recently sent from the mirror. -// 23.11.2014 +// 24.09.2022 // // This file is part of OTT mirror. // @@ -26,14 +26,16 @@ // #include #include -###TEMP_PATHr -###OK_PATH3 -###PM_PATH3 -###FAIL_PATH3 -###LS_PATH -###RM_PATH -###MAWK_PATH -###AWK_POSTED +// ###TEMP_PATHr +// ###C_OK_PATH_3: #define OK_PATH "/eizm/mem/ottmirror/mpost/ok/" +// ###C_PM_PATH_3: #define PM_PATH "/eizm/mem/ottmirror/mpost/pm/" +// ###C_FAIL_PATH_3: #define FAIL_PATH "/eizm/mem/ottmirror/mpost/fail/" +// ###C_LS_PATH: #define LS_PATH "/bin/ls" +// ###C_RM_PATH: #define RM_PATH "/bin/rm" +// ###C_MAWK_PATH: #define MAWK_PATH "/usr/bin/mawk" +// ###C_AWK_POSTED: #define AWK_POSTED "/eizm/pro/ottmirror/posted.awk" + +// ###C_OWN_DOMAIN_ENCODED: #define  "1190.bicyclesonthemoon.info" s_cgi *cgi; pid_t sub; @@ -62,7 +64,7 @@ int main(int argc, char **argv) printf("\n"); printf("\n"); printf("\n"); - printf("\"1190.bicyclesonthemoon.info\"\n"); + printf("\"%s\"\n", OWN_DOMAIN_ENCODED); printf("

    Posted from the ЯOЯЯIM TTO

    \n"); fflush(stdout); @@ -188,7 +190,7 @@ int main(int argc, char **argv) printf("
    \n"); } printf("back to the ЯOЯЯIM TTO

    \n"); - printf("1190.bicyclesonthemoon.info\n"); + printf("%s\n", OWN_DOMAIN_ENCODED); fflush(stdout); sub=fork(); diff --git a/posted.awk b/posted.awk index 42978d3..9e33182 100644 --- a/posted.awk +++ b/posted.awk @@ -1,5 +1,5 @@ # OTT mirror -# Copyright (C) 2014 Balthasar Szczepañski +# Copyright (C) 2014 Balthasar Szczepański # posted.awk # one post recently sent from the mirror # 2.08.2014 diff --git a/settings-release.txt b/settings-release.txt index 37aff34..528fe5b 100644 --- a/settings-release.txt +++ b/settings-release.txt @@ -2,11 +2,17 @@ target: release configure: /botm/bin/config/configure.pl useragent2: bothasar_t (http://1190.bicyclesonthemoon.info/ott/; Time thread mirror bot) +useragent3: bothasar_p (http://1190.bicyclesonthemoon.info/ott/; Time thread post bot) + bin_path: /botm/bin/ottmirror +log_path: /botm/log/ottmirror +mem_path: /botm/data/ottmirror +tmp_path: /botm/tmp/ottmirror +www_path: /botm/www/1190/ott -#ictaddr= "http://forums.xkcd.com/viewforum.php?f=7" -#ottaddr= "http://forums.xkcd.com/viewtopic.php?f=7&t=101043&start=" +ict_addr: http://forums.xkcd.com/viewforum.php?f=7 +ott_addr: http://forums.xkcd.com/viewtopic.php?f=7&t=101043&start= fora_addr: http://forums.xkcd.com wayback_addr: http://web.archive.org/web/ @@ -20,8 +26,15 @@ avatar_regexp: ((src)|(href))=.http:\/\/((for(ums3?|a)\.xkcd\.com)|echochamber\. attachment_regexp: ((src)|(href))=.http:\/\/(www\.)?((for(ums3?|a)\.xkcd\.com)|echochamber\.me)\/download\/file.php\?(mode=view\&)?id= own_image_regexp: ((1190.bicyclesonthemoon.(dnsd.)?info)|(1190-botm.dnsdynamic.com))\/ott\/image\/ +own_domain: 1190.bicyclesonthemoon.info +own_url: http://1190.bicyclesonthemoon.info/ott +bot3name: bothasar_p +bot3_url: http://1190.bicyclesonthemoon.info/bothasar_p/ +cat: /usr/bin/cat mv: /usr/bin/mv perl: /usr/bin/perl rm: /usr/bin/rm -wget: /usr/bin/wget \ No newline at end of file +ls: /usr/bin/ls +wget: /usr/bin/wget +awk: /usr/bin/mawk diff --git a/settings.txt b/settings.txt index 12d4c99..5b6d9c8 100644 --- a/settings.txt +++ b/settings.txt @@ -1,7 +1,82 @@ _AWK_DEFINE_STR: $0="@_ESCAPE($1)" +_C_DEFINE_STR: #define $0 "@_ESCAPE($1)" + +_bot3name_encoded = @_URL_ENCODE($bot3name) +_own_domain_encoded = @_URL_ENCODE($own_domain) +_own_url_encoded = @_URL_ENCODE($own_url) + +_bin_awk_b2h_path = @_PATH($bin_path, bb2html.awk) +_bin_awk_bot2_path = @_PATH($bin_path, bot2.awk) +_bin_awk_index_path = @_PATH($bin_path, index.awk) +_bin_awk_latest_path = @_PATH($bin_path, findlatest.awk) +_bin_awk_list_path = @_PATH($bin_path, list.awk) +_bin_awk_mview_path = @_PATH($bin_path, mview.awk) +_bin_awk_pm_path = @_PATH($bin_path, pm.awk) +_bin_awk_post_path = @_PATH($bin_path, post.awk) +_bin_awk_posted_path = @_PATH($bin_path, posted.awk) +_bin_awk_preview_path= @_PATH($bin_path, preview.awk) +_bin_awk_upload_path = @_PATH($bin_path, upload.awk) +_bin_awk_verify_path = @_PATH($bin_path, verify.awk) +_bin_awk_view_path = @_PATH($bin_path, view.awk) +_bin_findpost_path = @_PATH($bin_path, findpost) +_bin_image_path = @_PATH($bin_path, image) + +_log_bot2_path = @_PATH($log_path, bot2.log.) +_log_bot3_path = @_PATH($log_path, bot3.log) + +_mem_last_path = @_PATH($mem_path, lasttime.) +_mem_lasttm_path_3 = @_PATH($mem_path, bot3last) +_mem_list_path = @_PATH($mem_path, mlist) +_mem_name_path = @_PATH($mem_path, name) +_mem_post_path = @_PATH($mem_path, mpost) + +_mem_fail_path = @_PATH($_mem_post_path, fail) +_mem_last_path_3 = @_PATH($_mem_list_path, last) +_mem_ok_path = @_PATH($_mem_post_path, ok) +_mem_pm_path = @_PATH($_mem_post_path, pm) + +_mem_fail_path_ = @_PATH($_mem_fail_path,) +_mem_list_path_ = @_PATH($_mem_list_path,) +_mem_ok_path_ = @_PATH($_mem_ok_path,) +_mem_pm_path_ = @_PATH($_mem_pm_path,) +_mem_post_path_ = @_PATH($_mem_post_path,) + +_tmp_bot3cook_path = @_PATH($tmp_path, bot3cook) +_tmp_bot3post_path = @_PATH($tmp_path, bot3post) +_tmp_bot3stop_path = @_PATH($tmp_path, bot3stop) +_tmp_bot3temp_path = @_PATH($tmp_path, bot3temp) +_tmp_np_path_0 = @_PATH($tmp_path, np.p0.) +_tmp_np_path_1 = @_PATH($tmp_path, np.p1.) +_tmp_np_path_2 = @_PATH($tmp_path, np.p2.) +_tmp_np_path_3 = @_PATH($tmp_path, np.p3.) +_tmp_stop_path = @_PATH($tmp_path, fullstop.) + +_www_att_path = @_PATH($www_path, attachment) +_www_av_path = @_PATH($www_path, avatar) +_www_end_path = @_PATH($www_path, end) +_www_img_path = @_PATH($www_path, image) +_www_ind_path = @_PATH($www_path, ottfront) +_www_ind_path_3 = @_PATH($www_path, mfront) +_www_inf_path = @_PATH($www_path, otterinf) +_www_info_path = @_PATH($www_path, info.htm) +_www_list_path = @_PATH($www_path, postlist) +_www_post_path = @_PATH($www_path, post.htm) +_www_sig_path = @_PATH($www_path, sig) +_www_top_path = @_PATH($www_path, top) +_www_up_path = @_PATH($www_path, np) + +_www_last_path = @_PATH($_www_up_path, last) +_www_np_top_path = @_PATH($_www_up_path, top) +_www_np_end_path = @_PATH($_www_up_path, end) + +_www_att_path_ = @_PATH($_www_att_path,) +_www_av_path_ = @_PATH($_www_av_path,) +_www_img_path_ = @_PATH($_www_img_path,) +_www_inf_path_ = @_PATH($_www_inf_path,) +_www_list_path_ = @_PATH($_www_list_path,) +_www_sig_path_ = @_PATH($_www_sig_path,) +_www_up_path_ = @_PATH($_www_up_path,) -_bin_findpost_path = @_PATH($bin_path, findpost) -_bin_image_path = @_PATH($bin_path, image) MAKE_CONFIGURE = CONFIGURE = $configure MAKE_TARGET = TARGET = $target @@ -9,20 +84,111 @@ MAKE_TARGET = TARGET = $target MAKE_PERL = PERL = $perl MAKE_RM = RM = $rm -AWK_useragent_2 = \t@_AWK_DEFINE_STR(useragent, "$useragent2") + AWK_findpost_path = \t@_AWK_DEFINE_STR(findpost_path, $_bin_findpost_path) +AWK_fora = \t@_AWK_DEFINE_STR(fora, $fora_addr) AWK_imgformat_path = \t@_AWK_DEFINE_STR(imgformat_path, $_bin_image_path) +AWK_mv = \t@_AWK_DEFINE_STR(mv, $mv) +AWK_useragent_2 = \t@_AWK_DEFINE_STR(useragent, "$useragent2") +AWK_useragent_3 = \t@_AWK_DEFINE_STR(useragent, "$useragent3") AWK_wayback = \t@_AWK_DEFINE_STR(wayback, $wayback_addr) -AWK_fora = \t@_AWK_DEFINE_STR(fora, $fora_addr) AWK_wget = \t@_AWK_DEFINE_STR(wget, $wget) -AWK_mv = \t@_AWK_DEFINE_STR(mv, $mv) +AWK_attachment_regexp = /$attachment_regexp/ +AWK_avatar_regexp = /$avatar_regexp/ +AWK_bot3name_encoded = $_bot3name_encoded AWK_links_regexp = /$links_regexp/ +AWK_own_image_regexp = /$own_image_regexp/ +AWK_own_url_encoded = $_own_url_encoded AWK_prosilver_regexp = /$prosilver_regexp/ AWK_prosilver_regexp2 = /$prosilver_regexp2/ AWK_smiley_regexp = /$smiley_regexp/ AWK_smiley_regexp2 = /$smiley_regexp2/ -AWK_avatar_regexp = /$avatar_regexp/ -AWK_attachment_regexp = /$attachment_regexp/ -AWK_own_image_regexp = /$own_image_regexp/ -AWK_thread_id = $thread_id \ No newline at end of file +AWK_thread_id = $thread_id + +# data +C_BOT3NAME_ENCODED = @_C_DEFINE_STR(BOT3NAME_ENCODED, $_bot3name_encoded) +C_OWN_DOMAIN_ENCODED = @_C_DEFINE_STR(OWN_DOMAIN_ENCODED, $_own_domain_encoded) +C_USERAGENT_2 = @_C_DEFINE_STR(USERAGENT, $useragent2) +C_USERAGENT_3 = @_C_DEFINE_STR(USERAGENT, $useragent3) + +# URL +C_BOT3_URL = @_C_DEFINE_STR(BOT3_URL, $bot3_url) +C_FORA_ADDRESS = @_C_DEFINE_STR(FORA_ADDRESS, $fora_addr) +C_ICT_ADDRESS = @_C_DEFINE_STR(ICT_ADDRESS, $ict_addr) +C_OTT_ADDRESS = @_C_DEFINE_STR(OTT_ADDRESS, $ott_addr) +C_OTT_ADDRESS = @_C_DEFINE_STR(OTT_ADDRESS, $ott_addr) + +# dir-log +C_LOG_PATH_2 = @_C_DEFINE_STR(LOG_PATH, $_log_bot2_path) +C_LOG_PATH_3 = @_C_DEFINE_STR(LOG_PATH, $_log_bot3_path) + +# dir-mem +C_FAIL_PATH_3 = @_C_DEFINE_STR(FAIL_PATH, $_mem_fail_path_) +C_LAST_PATH = @_C_DEFINE_STR(LAST_PATH, $_mem_last_path) +C_LAST_PATH_3 = @_C_DEFINE_STR(LAST_PATH, $_mem_last_path_3) +C_LASTTM_PATH_3 = @_C_DEFINE_STR(LASTTIME_PATH, $_mem_lasttm_path_3) +C_LIST_PATH_3 = @_C_DEFINE_STR(LIST_PATH, $_mem_list_path_) +C_MLAST_PATH = @_C_DEFINE_STR(MLAST_PATH, $_mem_last_path_3) +C_MLIST_PATH = @_C_DEFINE_STR(MLIST_PATH, $_mem_list_path_) +C_MPOST_PATH = @_C_DEFINE_STR(MPOST_PATH, $_mem_post_path_) +C_NAME_PATH = @_C_DEFINE_STR(NAME_PATH, $_mem_name_path) +C_OK_PATH_3 = @_C_DEFINE_STR(OK_PATH, $_mem_ok_path_) +C_PM_PATH_3 = @_C_DEFINE_STR(PM_PATH, $_mem_pm_path_) +C_POST_PATH_3 = @_C_DEFINE_STR(POST_PATH, $_mem_post_path_) + +# dir-tmp +C_COOKIE_PATH_3 = @_C_DEFINE_STR(COOKIE_PATH, $_tmp_bot3cook_path) +C_NP_PATH_0 = @_C_DEFINE_STR(NP_PATH, $_tmp_np_path_0) +C_NP_PATH_1 = @_C_DEFINE_STR(NP_PATH_1, $_tmp_np_path_1) +C_NP_PATH_2 = @_C_DEFINE_STR(NP_PATH_2, $_tmp_np_path_2) +C_NP_PATH_3 = @_C_DEFINE_STR(NP_PATH_3, $_tmp_np_path_3) +C_POSTDATA_PATH_3 = @_C_DEFINE_STR(POSTDATA_PATH, $_tmp_bot3post_path) +C_STOP_PATH = @_C_DEFINE_STR(STOP_PATH, $_tmp_stop_path) +C_STOP_PATH_3 = @_C_DEFINE_STR(STOP_PATH, $_tmp_bot3stop_path) +C_TEMPFILE_PATH_3 = @_C_DEFINE_STR(TEMPFILE_PATH, $_tmp_bot3temp_path) + +# dir-www +C_ATT_PATH = @_C_DEFINE_STR(ATT_PATH, $_www_att_path_) +C_AV_PATH = @_C_DEFINE_STR(AV_PATH, $_www_av_path_) +C_END_PATH = @_C_DEFINE_STR(END_PATH, $_www_end_path) +C_IMG_PATH = @_C_DEFINE_STR(IMG_PATH, $_www_img_path_) +C_IND_PATH = @_C_DEFINE_STR(IND_PATH, $_www_ind_path) +C_IND_PATH_3 = @_C_DEFINE_STR(IND_PATH, $_www_ind_path_3) +C_IND_PATH_3_ = @_C_DEFINE_STR(IND_PATH_3, $_www_ind_path_3) +C_INF_PATH = @_C_DEFINE_STR(INF_PATH, $_www_inf_path_) +C_INFO_PATH = @_C_DEFINE_STR(INFO_PATH, $_www_info_path) +C_LAST_PAGE = @_C_DEFINE_STR(LAST_PAGE, $_www_last_path) +C_LIST_PATH = @_C_DEFINE_STR(LIST_PATH, $_www_list_path_) +C_MFRONT_PATH = @_C_DEFINE_STR(MFRONT_PATH, $_www_ind_path_3) +C_NP_TOP_PATH = @_C_DEFINE_STR(NP_TOP_PATH, $_www_np_top_path) +C_NP_END_PATH = @_C_DEFINE_STR(NP_END_PATH, $_www_np_end_path) +C_POST_PATH = @_C_DEFINE_STR(POST_PATH, $_www_post_path) +C_SIG_PATH = @_C_DEFINE_STR(SIG_PATH, $_www_sig_path_) +C_TOP_PATH = @_C_DEFINE_STR(TOP_PATH, $_www_top_path) +C_UP_PATH = @_C_DEFINE_STR(UP_PATH, $_www_up_path_) + +# tool +C_CAT_PATH = @_C_DEFINE_STR(CAT_PATH, $cat) +C_LS_PATH = @_C_DEFINE_STR(LS_PATH, $ls) +C_MAWK_PATH = @_C_DEFINE_STR(MAWK_PATH, $awk) +C_MV_PATH = @_C_DEFINE_STR(MV_PATH, $mv) +C_RM_PATH = @_C_DEFINE_STR(RM_PATH, $rm) +C_WGET_PATH = @_C_DEFINE_STR(WGET_PATH, $wget) + +# bin +C_AWK_B2H = @_C_DEFINE_STR(AWK_B2H, $_bin_awk_b2h_path) +C_AWK_BOT2 = @_C_DEFINE_STR(AWK_BOT2, $_bin_awk_bot2_path) +C_AWK_INDEX = @_C_DEFINE_STR(AWK_INDEX, $_bin_awk_index_path) +C_AWK_LATEST = @_C_DEFINE_STR(AWK_LATEST, $_bin_awk_latest_path) +C_AWK_LIST = @_C_DEFINE_STR(AWK_LIST, $_bin_awk_list_path) +C_AWK_MVIEW = @_C_DEFINE_STR(AWK_MVIEw, $_bin_awk_mview_path) +C_AWK_PM = @_C_DEFINE_STR(AWK_INDEX, $_bin_awk_pm_path) +C_AWK_POST = @_C_DEFINE_STR(AWK_POST, $_bin_awk_post_path) +C_AWK_POSTED = @_C_DEFINE_STR(AWK_POSTED, $_bin_awk_posted_path) +C_AWK_PREVIEW = @_C_DEFINE_STR(AWK_PREVIEW, $_bin_awk_preview_path) +C_AWK_UPLOAD = @_C_DEFINE_STR(AWK_UPLOAD, $_bin_awk_upload_path) +C_AWK_VERIFY = @_C_DEFINE_STR(AWK_VERIFY, $_bin_awk_verify_path) +C_AWK_VIEW = @_C_DEFINE_STR(AWK_VIEW, $_bin_awk_view_path) + +C_ = @_C_DEFINE_STR(uvw, $xyz)