#!/usr/bin/mawk -f BEGIN{ nextpost="/eizm/pro/mrobsniped/nextpost" thispost="/eizm/pro/mrobsniped/thispost" postfile="/eizm/pro/mrobsniped/postfile" userpass="/eizm/mem/ottmirror/name" tempf="tempfile=/eizm/pro/mrobsniped/tempf" postf="postfile=/eizm/pro/mrobsniped/postf" cookf="cookiefile=/eizm/pro/mrobsniped/cookf" mv="/bin/mv" mawk="/usr/bin/mawk" postawk="/eizm/pro/mrobsniped/post.awk" mpostawk="/eizm/pro/mrobsniped/mpost.awk" fscmd="ls -l" #rm="/bin/rm" for(i=0;i<256;++i) { ch=sprintf("%c",i) hex=sprintf("%02X",i) ch2hex[ch]=hex } fscmd = fscmd " " nextpost fscmd | getline lsline close(fscmd) split(lsline,lstab," ") nextpostsize = int(lstab[5]) # if(nextpostsize<729) if(nextpostsize<3300) exit if(system(mv" "nextpost" "thispost)) exit for(i=0;(getline line < thispost) > 0;++i) { if(i!=0) line="\n"line post=post line } close(thispost) getline name < userpass getline pass < userpass close(userpass) post="the [url=http://1190.bicyclesonthemoon.info/mrobsniped/mrobdexmessage-onlytext.txt]mr*bdex story[/url] cONGtinues.\n[quote]"post"[/quote]\n[right][size=85]-- posted by mr[img]http://1190.bicyclesonthemoon.info/ott/attachment/41728[/img]bdexbot[/size][/right]" print "username="name > postfile print "password="pass >>postfile print "subject="urlencode("bOTTeriada goes ONG") >>postfile print "addbbcode20=100" >>postfile print "message="urlencode(post,1) >>postfile print "disable_magic_url=on" close(postfile) if(system(mawk" -f "postawk" -v "postf" -v "tempf" -v "cookf" "postfile)!=0) system(mawk" -f "mpostawk" -v "postf" -v "tempf" -v "cookf" "postfile) #system(rm" "thispost) #system(rm" "postfile) } { } 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 }