Is there an issue? Send a MessageReason:
None
Changed line(s) 376 (click to see context) from:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
to:
@@[= =][= =][= =][= =][={ =][={ 589, 1786, 585, 1781, 1785,=]@@
Is there an issue? Send a MessageReason:
dammit, tv tropes
Changed line(s) 146 (click to see context) from:
@@[= =][= =][= =][= =][="[[folder:%s]]\n%s\n[[/folder]]",=]@@
to:
@@[= =][= =][= =][= =][="[[folder:%s]]\n%s\n[[/folder]]",=]@@=][="[[folder:%s]]\n%s\n[[/folder]=]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape everything, and only fiddle with=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--what must be fiddled with=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--what must be fiddled with=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--also split the folder controls, because hurf durf that ignores=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--non-formatting=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(escaped,"folder]=]][=","folder]=]=[=]][=")=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--non-formatting=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(escaped,"folder]=]][=","folder]=]=[=]][=")=]@@
\\
Changed line(s) 168 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start _every single instance of a line=]@@more than two adjacent spaces_=]@@
Changed line(s) 203 (click to see context) from:
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
to:
@@[= =][= =][= =][= =][=if not posted then print" print" Retrying..." end=]@@
Changed line(s) 209 (click to see context) from:
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
to:
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@"dammit, tv tropes"=]@@
Changed line(s) 369,374 (click to see context) from:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
to:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=580, 590, 588, 586, =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=576, 579, 577, 644, =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=591, 582, 584, 578, =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=583, =][=583, 587},=]@@
@@[= =][= =][= =][==][={ 6641, 6644, 6643, 6638, =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 378 (click to see context) from:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
to:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, =][={ 6640, 6642, 6635, 6636, 6637,=]@@
Is there an issue? Send a MessageReason:
Now without tokens appearing in the scripts themselves for safety
Changed line(s) 12 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
to:
@@[=local urlencode=]=[={}=]@@urlencode={}=]@@
Changed line(s) 17 (click to see context) from:
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
to:
@@[= =][= =][=str =]=[= = string.gsub (str, "\r?\n", "\r\n")=]@@
Changed line(s) 21,22 (click to see context) from:
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
to:
@@[= =][= =][=str =]=[= = string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
"([^%w%-%.%_%~ ])",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format("=]%[==]%[==]%[=02X", ("%%%02X", string.byte(c)) end)=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format
Changed line(s) 28 (click to see context) from:
@@[=urlencode.string =]=[= encode=]@@
to:
@@[=urlencode.string =]=[= = encode=]@@
Changed line(s) 33 (click to see context) from:
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
to:
@@[= =][= =][=local argts, i=]=[= i= {}, 1=]@@
Changed line(s) 35,36 (click to see context) from:
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
to:
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..=][=argts[i]=encode(k).."="..encode(v)=]@@
@@[= =][= =][= =][==][=i=]=[=i+1=]@@=][=i=i+1=]@@
@@[= =][= =][= =][=
Changed line(s) 46 (click to see context) from:
@@[=local http =]=[= require"socket.http"=]@@
to:
@@[=local http =]=[= = require"socket.http"=]@@
Changed line(s) 49 (click to see context) from:
@@[=local urlencode =]=[= require "urlencode"=]@@
to:
@@[=local urlencode =]=[= = require "urlencode"=]@@
Changed line(s) 51 (click to see context) from:
@@[=local tvtropes=]=[={}=]@@
to:
@@[=local tvtropes=]=[={}=]@@tvtropes={}=]@@
Changed line(s) 60 (click to see context) from:
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
to:
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination =][=assert(type(page)=="string","Destination page name required")=]@@
Changed line(s) 62 (click to see context) from:
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
to:
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page="Main/"..page end=]@@
Changed line(s) 70 (click to see context) from:
@@[= =][= =][=page=]=[=fullname(page)=]@@
to:
@@[= =][= =][=page=]=[=fullname(page)=]@@=][=page=fullname(page)=]@@
Changed line(s) 72 (click to see context) from:
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
to:
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page =][=assert(type(body)=="string","Page body required")=]@@
Changed line(s) 74 (click to see context) from:
@@[= =][= =][=local response =]=[==]@@
to:
@@[= =][= =][=local response =]=[==]@@==]@@
Changed line(s) 77,80 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
=][=action="post", post="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=pagename=]=[=page, text=]=[=body,=]@@
=][=pagename=page, text=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=author=]=[=author =][=author=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=reason=]=[=reason =][=reason=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 84 (click to see context) from:
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
to:
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@=][=assert(response[1],response[2])=]@@
Changed line(s) 88,89 (click to see context) from:
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
to:
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 tonumber(response[2])~=302 then=]@@
@@[= =][= =][= =][= =][=return nil,response[2=]][=, response[1=]][==]@@response[2], response[1]=]@@
@@[= =][= =][= =][= =][=return nil,
Changed line(s) 98 (click to see context) from:
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
to:
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@= {quot='"', amp='&', lt='<', gt='>'}=]@@
Changed line(s) 101,102 (click to see context) from:
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
to:
@@[= =][= =][= =][= =][=src=]=[=string.=][=src=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][==][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@=][=src=string.gsub(src,"&(%w-);",ents)=]@@
@@[= =][= =][= =][=
Changed line(s) 110 (click to see context) from:
@@[= =][= =][=page=]=[=fullname(page)=]@@
to:
@@[= =][= =][=page=]=[=fullname(page)=]@@=][=page=fullname(page)=]@@
Changed line(s) 112,113 (click to see context) from:
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
to:
@@[= =][= =][=local body, code =]=[= = http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@'?action=source')=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..
Changed line(s) 132 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
to:
@@[=local tvtropes =]=[= = require "tvtropes"=]@@
Changed line(s) 134,135 (click to see context) from:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
to:
@@[=local target =]=[= = "Tropers/STUART"=]@@
@@[=localuser=]=[="STUART"=]@@user="STUART"=]@@
@@[=local
Changed line(s) 137 (click to see context) from:
@@[=local scripts=]=[={=]@@
to:
@@[=local scripts=]=[={=]@@scripts={=]@@
Changed line(s) 146 (click to see context) from:
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
to:
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@=][="[[folder:%s]]\n%s\n[[/folder]]",=]@@
Changed line(s) 151,153 (click to see context) from:
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
to:
@@[= =][= =][=local folders=]=[={=]@@
folders={=]@@
@@[= =][= =][= =][==][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
=][="%%START".."SCRIPTS%%",=]@@
@@[= =][= =][= =][==][="[[foldercontrol=]][==]][="=]@@=][="[[foldercontrol]]"=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 155 (click to see context) from:
@@[= =][= =][=local headers=]=[=#folders=]@@
to:
@@[= =][= =][=local headers=]=[=#folders=]@@headers=#folders=]@@
Changed line(s) 157,159 (click to see context) from:
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
to:
@@[= =][= =][=for i=]=[=1, i=1, #scripts do=]@@
@@[= =][= =][= =][= =][=localslines=]=[={}=]@@
slines={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) lines(scripts[i]) do=]@@
@@[= =][= =][= =][= =][=local
@@[= =][= =][= =][= =][=for line in io.
Changed line(s) 161,162 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" line=="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=slines[#slines+1=]][==]=[='\\\\'=]@@=][=slines[#slines+1]='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 164,168 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
=][=--split anything that would end the escaped region=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=localescaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@escaped=string.gsub(line,"=]=[=]","=]=[=]=[=]=[=]")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
Changed line(s) 173,174 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.=][=escaped=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," ","=]=[==]][=[=]=[=")=]@@=]=[=][=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," ","
Changed line(s) 177 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@=][=slines[#slines+1]=string.format("@@[=%s=]=[=]@@",escaped)=]@@
Changed line(s) 181,182 (click to see context) from:
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
to:
@@[= =][= =][= =][= =][=local content=]=[=table.content=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][==][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@=][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@
@@[= =][= =][= =][=
Changed line(s) 185 (click to see context) from:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
to:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@=][=folders[#folders+1]="%%END".."SCRIPTS%%"=]@@
Changed line(s) 191 (click to see context) from:
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
Changed line(s) 193 (click to see context) from:
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
to:
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...%s...",target))=]@@
Changed line(s) 195 (click to see context) from:
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
to:
@@[= =][= =][=local current=]=[=tvtropes.current=tvtropes.get(target)=]@@
Changed line(s) 197,198 (click to see context) from:
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
to:
@@[= =][= =][=local updated=]=[=string.updated=string.gsub(current,=]@@
@@[= =][= =][= =][==][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@=][="%%%%START".."SCRIPTS%%%%.-%%%%END".."SCRIPTS%%%%",=]@@
@@[= =][= =][= =][=
Changed line(s) 201 (click to see context) from:
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
to:
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...%s...",target))=]@@
Changed line(s) 205,206 (click to see context) from:
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
to:
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.=][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted thenprint" print" Retrying..." end=]@@
@@[= =][= =][= =][= =][=if not posted then
Changed line(s) 220 (click to see context) from:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
to:
@@[=local tvtropes=]=[=require tvtropes=require "tvtropes"=]@@
Changed line(s) 222 (click to see context) from:
@@[=local urlencode=]=[=require "urlencode"=]@@
to:
@@[=local urlencode=]=[=require urlencode=require "urlencode"=]@@
Changed line(s) 225 (click to see context) from:
@@[=adeps=]=[={=]@@
to:
Changed line(s) 289 (click to see context) from:
@@[=local tokens=]=[={}=]@@
to:
@@[=local tokens=]=[={}=]@@tokens={}=]@@
Changed line(s) 294 (click to see context) from:
@@[= =][= =][=local disambigeps=]=[={=]@@
to:
@@[= =][= =][=local disambigeps=]=[={=]@@disambigeps={=]@@
Changed line(s) 301,305 (click to see context) from:
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
to:
@@[= =][= =][=local disambiguated=]=[={}=]@@
disambiguated={}=]@@
@@[= =][= =][=fors=]=[=1,#disambigeps s=1,#disambigeps do=]@@
@@[= =][= =][= =][==][=disambiguated[s=]][==]=[={}=]@@
=][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=fori=]=[=1,#disambigeps[s=]][= i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][==][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@=][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][=for
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][=for
@@[= =][= =][= =][= =][= =][=
Changed line(s) 311,314 (click to see context) from:
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
to:
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
pagename=adeps[s][e]=]@@
@@[= =][= =][= =][==][=pagename=]=[=string.=][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][==][=pagename=]=[=urlencode.=][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=ifdisambiguated[s=]][=[e=]][= disambiguated[s][e] then=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][=if
Changed line(s) 319 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename..=][=pagename=pagename.."_(Arrested_Development)"=]@@
Changed line(s) 328,330 (click to see context) from:
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
to:
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
pagename=adeps[s][e]=]@@
@@[= =][= =][= =][==][=pagename=]=[=string.=][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][==][=pagename=]=[=urlencode.=][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 336 (click to see context) from:
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
to:
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
Changed line(s) 341,342 (click to see context) from:
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
to:
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 s==1 then e =]=[= s1flips[e=]][= = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@com/episode/%i%02i",s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.
Changed line(s) 349 (click to see context) from:
@@[= =][= =][=local ttnums=]=[={=]@@
to:
@@[= =][= =][=local ttnums=]=[={=]@@ttnums={=]@@
Changed line(s) 366 (click to see context) from:
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
to:
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@com/title/tt%07i/",ttnums[s][e])=]@@
Changed line(s) 371,377 (click to see context) from:
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
to:
@@[= =][= =][=local watchnums=]=[={=]@@
watchnums={=]@@
@@[= =][= =][= =][==][={ 589, 1786, 585, 1781, =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=580, 590, 588, 586, =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=576, 579, 577, 644, =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=591, 582, 584, 578, =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=583, =][=583, 587},=]@@
@@[= =][= =][= =][==][={ 6641, 6644, 6643, 6638, =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 381 (click to see context) from:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
to:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, =][={ 6640, 6642, 6635, 6636, 6637,=]@@
Changed line(s) 388 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@com/watch/%i", watchnums[s][e])=]@@
Changed line(s) 397 (click to see context) from:
@@[= =][= =][=local movieids=]=[={=]@@
to:
@@[= =][= =][=local movieids=]=[={=]@@movieids={=]@@
Changed line(s) 414 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@com/WiPlayer?movieid=%i",movieids[s][e])=]@@
Changed line(s) 423,424 (click to see context) from:
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
to:
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=%%STARTLINKS%%=]@@
Changed line(s) 426 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= Wikipedia]] -- [[$wikia Wikia=]][==]][= Wikia]] -- [[$theop Balboa Observer-Picayune=]][==]][= Observer-Picayune]] -- [[$imdb IMDB=]][==]][==]@@IMDB]]=]@@
Changed line(s) 428 (click to see context) from:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
to:
@@[=Watch now: [[$hulu Hulu=]][==]][= Hulu]] -- [[$netflix Netflix=]][==]][==]@@Netflix]]=]@@
Changed line(s) 430,431 (click to see context) from:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[==]][==]=[==]][==]@@
to:
@@[==]][==]=[==]][==]@@
@@[=]=]=[=]=]@@
Changed line(s) 433 (click to see context) from:
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
to:
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) gsub(template,"%$(%w+)",function(token) return tokens[token=]][=(s,e) tokens[token](s,e) end))=]@@
Changed line(s) 440 (click to see context) from:
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
to:
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@title=adeps[s][e]=]@@
Changed line(s) 442 (click to see context) from:
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
to:
@@[= =][= =][=title=]=[=string.=][=title=string.gsub(title,'é','e')=]@@
Changed line(s) 444 (click to see context) from:
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
to:
@@[= =][= =][=title=]=[=string.=][=title=string.gsub(title,' (=]%[=l?)',string.(%l?)',string.upper)=]@@
Changed line(s) 446 (click to see context) from:
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
to:
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@=][=title=string.gsub(title,'%W','')=]@@
Changed line(s) 448 (click to see context) from:
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
to:
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
Changed line(s) 455,456 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@=][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 464 (click to see context) from:
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
to:
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 s==2 and e=]=[==]=[=3 e==3 then=]@@
Changed line(s) 467,469 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=localpageasis=]=[=tvtropes.pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks=]=[= = string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks
Changed line(s) 473,474 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.
Changed line(s) 483,485 (click to see context) from:
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
to:
@@[= =][= =][=for s=]=[=1,#adeps s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=fore=]=[=1,#adeps[s=]][= e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season=]%[=i %i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@%i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][=for
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season
Is there an issue? Send a MessageReason:
Now without tokens appearing in the scripts themselves for safety
Added DiffLines:
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
Is there an issue? Send a MessageReason:
d'oh...
Deleted line(s) 9,1292 (click to see context) :
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%"=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of %s...",target))=]@@
\\
@@[= =][= =][=local current=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%%%",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of %s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated={}=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s==1 then e = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia]] -- [[$wikia Wikia]] -- [[$theop Balboa Observer-Picayune]] -- [[$imdb IMDB]]=]@@
\\
@@[=Watch now: [[$hulu Hulu]] -- [[$netflix Netflix]]=]@@
@@[=----=]@@
@@[=%%ENDLINKS%%=]@@
@@[=]=]=]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) return tokens[token](s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=adeps[s][e]=]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=string.gsub(title,' (%l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s==2 and e==3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%"=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of %s...",target))=]@@
\\
@@[= =][= =][=local current=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "Now without tokens appearing in the scripts themselves for safety"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%%%",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of %s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated={}=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s==1 then e = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia]] -- [[$wikia Wikia]] -- [[$theop Balboa Observer-Picayune]] -- [[$imdb IMDB]]=]@@
\\
@@[=Watch now: [[$hulu Hulu]] -- [[$netflix Netflix]]=]@@
@@[=----=]@@
@@[=%%ENDLINKS%%=]@@
@@[=]=]=]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) return tokens[token](s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=adeps[s][e]=]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=string.gsub(title,' (%l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s==2 and e==3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
Is there an issue? Send a MessageReason:
Now without tokens appearing in the scripts themselves for safety
Changed line(s) 152 (click to see context) from:
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
to:
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@=][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
Changed line(s) 185 (click to see context) from:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@=][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
Changed line(s) 198 (click to see context) from:
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
to:
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@=][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
Changed line(s) 206 (click to see context) from:
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
to:
@@[= =][= =][= =][= =][=if not posted then print" print" Retrying..." end=]@@
Changed line(s) 212 (click to see context) from:
@@[=push "bloody spaces"=]@@
to:
@@[=push "bloody spaces"=]@@"Now without tokens appearing in the scripts themselves for safety"=]@@
Changed line(s) 372,377 (click to see context) from:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
to:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=580, 590, 588, 586, =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=576, 579, 577, 644, =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=591, 582, 584, 578, =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=583, =][=583, 587},=]@@
@@[= =][= =][= =][==][={ 6641, 6644, 6643, 6638, =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 381 (click to see context) from:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
to:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, =][={ 6640, 6642, 6635, 6636, 6637,=]@@
Changed line(s) 653 (click to see context) from:
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
to:
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@=][="=]%[==]%[=START".."SCRIPTS=]%[==]%[=",=]@@
Changed line(s) 686 (click to see context) from:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@=][=folders[#folders+1=]][==]=[="=]%[==]%[=END".."SCRIPTS=]%[==]%[="=]@@
Changed line(s) 699 (click to see context) from:
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
to:
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@=][="=]%[==]%[==]%[==]%[=START".."SCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=END".."SCRIPTS=]%[==]%[==]%[==]%[=",=]@@
Changed line(s) 707 (click to see context) from:
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
to:
@@[= =][= =][= =][= =][=if not posted then print" print" Retrying..." end=]@@
Changed line(s) 713 (click to see context) from:
@@[=push "bloody spaces"=]@@
to:
@@[=push "bloody spaces"=]@@"Now without tokens appearing in the scripts themselves for safety"=]@@
Changed line(s) 873,878 (click to see context) from:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
to:
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=580, 590, 588, 586, =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=576, 579, 577, 644, =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=591, 582, 584, 578, =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=583, =][=583, 587},=]@@
@@[= =][= =][= =][==][={ 6641, 6644, 6643, 6638, =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 882 (click to see context) from:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
to:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, =][={ 6640, 6642, 6635, 6636, 6637,=]@@
Is there an issue? Send a MessageReason:
bloody spaces
Changed line(s) 12 (click to see context) from:
@@[=local urlencode={}=]@@
to:
@@[=local urlencode={}=]@@urlencode=]=[={}=]@@
Changed line(s) 17 (click to see context) from:
@@[= =][= =][=str = string.gsub (str, "\r?\n", "\r\n")=]@@
to:
@@[= =][= =][=str = =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
Changed line(s) 21,22 (click to see context) from:
@@[= =][= =][=str = string.gsub (str, "([^%w%-%.%_%~ ])",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("%%%02X", string.byte(c)) end)=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("%%%02X", string.byte(c)) end)=]@@
to:
@@[= =][= =][=str = =]=[= string.gsub (str, "([^%w%-%.%_%~ ])",=]@@
"([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format("%%%02X", ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format
Changed line(s) 28 (click to see context) from:
@@[=urlencode.string = encode=]@@
to:
@@[=urlencode.string = =]=[= encode=]@@
Changed line(s) 33 (click to see context) from:
@@[= =][= =][=local argts, i= {}, 1=]@@
to:
@@[= =][= =][=local argts, i= i=]=[= {}, 1=]@@
Changed line(s) 35,36 (click to see context) from:
@@[= =][= =][= =][= =][=argts[i]=encode(k).."="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=i+1=]@@
@@[= =][= =][= =][= =][=i=i+1=]@@
to:
@@[= =][= =][= =][= =][=argts[i]=encode(k).."="..=][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][==][=i=i+1=]@@=][=i=]=[=i+1=]@@
@@[= =][= =][= =][=
Changed line(s) 46 (click to see context) from:
@@[=local http = require"socket.http"=]@@
to:
@@[=local http = =]=[= require"socket.http"=]@@
Changed line(s) 49 (click to see context) from:
@@[=local urlencode = require "urlencode"=]@@
to:
@@[=local urlencode = =]=[= require "urlencode"=]@@
Changed line(s) 51 (click to see context) from:
@@[=local tvtropes={}=]@@
to:
@@[=local tvtropes={}=]@@tvtropes=]=[={}=]@@
Changed line(s) 60 (click to see context) from:
@@[= =][= =][=assert(type(page)=="string","Destination page name required")=]@@
to:
@@[= =][= =][=assert(type(page)=="string","Destination =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
Changed line(s) 62 (click to see context) from:
@@[= =][= =][=if not string.find(page,'/') then page="Main/"..page end=]@@
to:
@@[= =][= =][=if not string.find(page,'/') then page="Main/"..page=]=[="Main/"..page end=]@@
Changed line(s) 70 (click to see context) from:
@@[= =][= =][=page=fullname(page)=]@@
to:
@@[= =][= =][=page=fullname(page)=]@@=][=page=]=[=fullname(page)=]@@
Changed line(s) 72 (click to see context) from:
@@[= =][= =][=assert(type(body)=="string","Page body required")=]@@
to:
@@[= =][= =][=assert(type(body)=="string","Page =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
Changed line(s) 74 (click to see context) from:
@@[= =][= =][=local response ==]@@
to:
@@[= =][= =][=local response ==]@@=]=[==]@@
Changed line(s) 77,80 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action="post", post="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=page, text=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=page, text=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=reason or ""=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action="post", post="save",=]@@
=][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=pagename=page, text=body,=]@@
=][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=author=author =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=reason=reason =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 84 (click to see context) from:
@@[= =][= =][=assert(response[1],response[2])=]@@
to:
@@[= =][= =][=assert(response[1],response[2])=]@@=][=assert(response[1=]][=,response[2=]][=)=]@@
Changed line(s) 88,89 (click to see context) from:
@@[= =][= =][=if tonumber(response[2])~=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2], response[1]=]@@
@@[= =][= =][= =][= =][=return nil, response[2], response[1]=]@@
to:
@@[= =][= =][=if tonumber(response[2])~=302 tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil,response[2], response[1]=]@@response[2=]][=, response[1=]][==]@@
@@[= =][= =][= =][= =][=return nil,
Changed line(s) 98 (click to see context) from:
@@[= =][= =][=local ents = {quot='"', amp='&', lt='<', gt='>'}=]@@
to:
@@[= =][= =][=local ents = {quot='"', amp='&', lt='<', gt='>'}=]@@=]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
Changed line(s) 101,102 (click to see context) from:
@@[= =][= =][= =][= =][=src=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=string.gsub(src,"&(%w-);",ents)=]@@
@@[= =][= =][= =][= =][=src=string.gsub(src,"&(%w-);",ents)=]@@
to:
@@[= =][= =][= =][= =][=src=string.=][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][==][=src=string.gsub(src,"&(%w-);",ents)=]@@=][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][=
Changed line(s) 110 (click to see context) from:
@@[= =][= =][=page=fullname(page)=]@@
to:
@@[= =][= =][=page=fullname(page)=]@@=][=page=]=[=fullname(page)=]@@
Changed line(s) 112,113 (click to see context) from:
@@[= =][= =][=local body, code = http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=source')=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=source')=]@@
to:
@@[= =][= =][=local body, code = =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=source')=]@@'?action=]=[=source')=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..
Changed line(s) 132 (click to see context) from:
@@[=local tvtropes = require "tvtropes"=]@@
to:
@@[=local tvtropes = =]=[= require "tvtropes"=]@@
Changed line(s) 134,135 (click to see context) from:
@@[=local target = "Tropers/STUART"=]@@
@@[=local user="STUART"=]@@
@@[=local user="STUART"=]@@
to:
@@[=local target = =]=[= "Tropers/STUART"=]@@
@@[=localuser="STUART"=]@@user=]=[="STUART"=]@@
@@[=local
Changed line(s) 137 (click to see context) from:
@@[=local scripts={=]@@
to:
@@[=local scripts={=]@@scripts=]=[={=]@@
Changed line(s) 146 (click to see context) from:
@@[= =][= =][= =][= =][="[[folder:%s]]\n%s\n[[/folder]]",=]@@
to:
@@[= =][= =][= =][= =][="[[folder:%s]]\n%s\n[[/folder]]",=]@@=][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
Changed line(s) 151,153 (click to see context) from:
@@[= =][= =][=local folders={=]@@
@@[= =][= =][= =][= =][="%%STARTSCRIPTS%%",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol]]"=]@@
@@[= =][= =][= =][= =][="%%STARTSCRIPTS%%",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol]]"=]@@
to:
@@[= =][= =][=local folders={=]@@
folders=]=[={=]@@
@@[= =][= =][= =][==][="%%STARTSCRIPTS%%",=]@@
=][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][==][="[[foldercontrol]]"=]@@=][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 155 (click to see context) from:
@@[= =][= =][=local headers=#folders=]@@
to:
@@[= =][= =][=local headers=#folders=]@@headers=]=[=#folders=]@@
Changed line(s) 157,159 (click to see context) from:
@@[= =][= =][=for i=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i]) do=]@@
@@[= =][= =][= =][= =][=local slines={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i]) do=]@@
to:
@@[= =][= =][=for i=1, i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=localslines={}=]@@
slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i]) lines(scripts[i=]][=) do=]@@
@@[= =][= =][= =][= =][=local
@@[= =][= =][= =][= =][=for line in io.
Changed line(s) 161,162 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=if line=="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]='\\\\'=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=if line=="" line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=slines[#slines+1]='\\\\'=]@@=][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 165 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=string.gsub(line,"[%~%=%]%%]",=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=string.gsub(line,"[%~%=%]%%]",=]@@escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
Changed line(s) 167 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]&#%i;[=",string.byte(char))=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]&#%i;[=",string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
Changed line(s) 173,174 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(line,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =][=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =][=")=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(line,"^ =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," ","=][=")=]@@=]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," ","
Changed line(s) 177 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]=string.format("@@[=%s=]@@",escaped)=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]=string.format("@@[=%s=]@@",escaped)=]@@=][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
Changed line(s) 181,182 (click to see context) from:
@@[= =][= =][= =][= =][=local content=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@
@@[= =][= =][= =][= =][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@
to:
@@[= =][= =][= =][= =][=local content=table.content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][==][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@=][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][= =][=
Changed line(s) 185 (click to see context) from:
@@[= =][= =][=folders[#folders+1]="%%ENDSCRIPTS%%"=]@@
to:
@@[= =][= =][=folders[#folders+1]="%%ENDSCRIPTS%%"=]@@=][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
Changed line(s) 191 (click to see context) from:
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
to:
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 193 (click to see context) from:
@@[= =][= =][=print(string.format("Getting current version of %s...",target))=]@@
to:
@@[= =][= =][=print(string.format("Getting current version of %s...=]%[=s...",target))=]@@
Changed line(s) 195 (click to see context) from:
@@[= =][= =][=local current=tvtropes.get(target)=]@@
to:
@@[= =][= =][=local current=tvtropes.current=]=[=tvtropes.get(target)=]@@
Changed line(s) 197,198 (click to see context) from:
@@[= =][= =][=local updated=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%%%.-%%%%ENDSCRIPTS%%%%",=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%%%.-%%%%ENDSCRIPTS%%%%",=]@@
to:
@@[= =][= =][=local updated=string.updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][==][="%%%%STARTSCRIPTS%%%%.-%%%%ENDSCRIPTS%%%%",=]@@=][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][=
Changed line(s) 201 (click to see context) from:
@@[= =][= =][=print(string.format("Posting new version of %s...",target))=]@@
to:
@@[= =][= =][=print(string.format("Posting new version of %s...=]%[=s...",target))=]@@
Changed line(s) 205,206 (click to see context) from:
@@[= =][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
to:
@@[= =][= =][= =][= =][=posted=tvtropes.=][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted thenprint" print" Retrying..." end=]@@
@@[= =][= =][= =][= =][=if not posted then
Changed line(s) 220 (click to see context) from:
@@[=local tvtropes=require "tvtropes"=]@@
to:
@@[=local tvtropes=require tvtropes=]=[=require "tvtropes"=]@@
Changed line(s) 222 (click to see context) from:
@@[=local urlencode=require "urlencode"=]@@
to:
@@[=local urlencode=require urlencode=]=[=require "urlencode"=]@@
Changed line(s) 225 (click to see context) from:
@@[=adeps={=]@@
to:
Changed line(s) 289 (click to see context) from:
@@[=local tokens={}=]@@
to:
@@[=local tokens={}=]@@tokens=]=[={}=]@@
Changed line(s) 294 (click to see context) from:
@@[= =][= =][=local disambigeps={=]@@
to:
@@[= =][= =][=local disambigeps={=]@@disambigeps=]=[={=]@@
Changed line(s) 301,305 (click to see context) from:
@@[= =][= =][=local disambiguated={}=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
to:
@@[= =][= =][=local disambiguated={}=]@@
disambiguated=]=[={}=]@@
@@[= =][= =][=fors=1,#disambigeps s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][==][=disambiguated[s]={}=]@@
=][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=fori=1,#disambigeps[s] i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][==][=disambiguated[s][disambigeps[s][i]]=true=]@@=][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][=for
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][=for
@@[= =][= =][= =][= =][= =][=
Changed line(s) 311,314 (click to see context) from:
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
to:
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][==][=pagename=string.=][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][==][=pagename=urlencode.=][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=ifdisambiguated[s][e] disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][=if
Changed line(s) 319 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename..=][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
Changed line(s) 328,330 (click to see context) from:
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
to:
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][==][=pagename=string.=][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][==][=pagename=urlencode.=][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 336 (click to see context) from:
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
to:
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
Changed line(s) 341,342 (click to see context) from:
@@[= =][= =][= =][= =][=if s==1 then e = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
to:
@@[= =][= =][= =][= =][=if s==1 s=]=[==]=[=1 then e = s1flips[e] =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.
Changed line(s) 349 (click to see context) from:
@@[= =][= =][=local ttnums={=]@@
to:
@@[= =][= =][=local ttnums={=]@@ttnums=]=[={=]@@
Changed line(s) 366 (click to see context) from:
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@
to:
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
Changed line(s) 371,377 (click to see context) from:
@@[= =][= =][=local watchnums={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
to:
@@[= =][= =][=local watchnums={=]@@
watchnums=]=[={=]@@
@@[= =][= =][= =][==][={ 589, 1786, 585, 1781, =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=580, 590, 588, 586, =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=576, 579, 577, 644, =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=591, 582, 584, 578, =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][==][=583, =][=583, 587},=]@@
@@[= =][= =][= =][==][={ 6641, 6644, 6643, 6638, =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=
@@[= =][= =][= =][=
Changed line(s) 381 (click to see context) from:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
to:
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, =][={ 6640, 6642, 6635, 6636, 6637,=]@@
Changed line(s) 388 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
Changed line(s) 397 (click to see context) from:
@@[= =][= =][=local movieids={=]@@
to:
@@[= =][= =][=local movieids={=]@@movieids=]=[={=]@@
Changed line(s) 414 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
Changed line(s) 423,424 (click to see context) from:
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[=%%STARTLINKS%%=]@@
to:
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=%%STARTLINKS%%=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
Changed line(s) 426 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia]] -- [[$wikia Wikia]] -- [[$theop Balboa Observer-Picayune]] -- [[$imdb IMDB]]=]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia]] Wikipedia=]][==]][= -- [[$wikia Wikia]] Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune]] Observer-Picayune=]][==]][= -- [[$imdb IMDB]]=]@@IMDB=]][==]][==]@@
Changed line(s) 428 (click to see context) from:
@@[=Watch now: [[$hulu Hulu]] -- [[$netflix Netflix]]=]@@
to:
@@[=Watch now: [[$hulu Hulu]] Hulu=]][==]][= -- [[$netflix Netflix]]=]@@Netflix=]][==]][==]@@
Changed line(s) 430,431 (click to see context) from:
@@[=%%ENDLINKS%%=]@@
@@[=]=]=]@@
@@[=]=]=]@@
to:
@@[=]=]=]@@
@@[==]][==]=[==]][==]@@
Changed line(s) 433 (click to see context) from:
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) return tokens[token](s,e) end))=]@@
to:
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token](s,e) tokens[token=]][=(s,e) end))=]@@
Changed line(s) 440 (click to see context) from:
@@[= =][= =][=local title=adeps[s][e]=]@@
to:
@@[= =][= =][=local title=adeps[s][e]=]@@title=]=[=adeps[s=]][=[e=]][==]@@
Changed line(s) 442 (click to see context) from:
@@[= =][= =][=title=string.gsub(title,'é','e')=]@@
to:
@@[= =][= =][=title=string.=][=title=]=[=string.gsub(title,'é','e')=]@@
Changed line(s) 444 (click to see context) from:
@@[= =][= =][=title=string.gsub(title,' (%l?)',string.upper)=]@@
to:
@@[= =][= =][=title=string.=][=title=]=[=string.gsub(title,' (%l?)',string.(=]%[=l?)',string.upper)=]@@
Changed line(s) 446 (click to see context) from:
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@
to:
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@=][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
Changed line(s) 448 (click to see context) from:
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
to:
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
Changed line(s) 455,456 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
to:
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"%s\" \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][==][=ad_ep_links(s,e),adeps[s][e]),=]@@=][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=
Changed line(s) 464 (click to see context) from:
@@[= =][= =][= =][= =][=if s==2 and e==3 then=]@@
to:
@@[= =][= =][= =][= =][=if s==2 s=]=[==]=[=2 and e==3 e=]=[==]=[=3 then=]@@
Changed line(s) 467,469 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
to:
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=localpageasis=tvtropes.pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks= =]=[= string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks
Changed line(s) 473,474 (click to see context) from:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
to:
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.
Changed line(s) 483,485 (click to see context) from:
@@[= =][= =][=for s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
to:
@@[= =][= =][=for s=1,#adeps s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=fore=1,#adeps[s] e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season%i =]%[=i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@=]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][=for
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season
Added DiffLines:
%%ENDSCRIPTS%%"=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of %s...",target))=]@@
\\
@@[= =][= =][=local current=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%%%",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of %s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated={}=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s==1 then e = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia]] -- [[$wikia Wikia]] -- [[$theop Balboa Observer-Picayune]] -- [[$imdb IMDB]]=]@@
\\
@@[=Watch now: [[$hulu Hulu]] -- [[$netflix Netflix]]=]@@
@@[=----=]@@
@@[=%%ENDLINKS%%=]@@
@@[=]=]=]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) return tokens[token](s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=adeps[s][e]=]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=string.gsub(title,' (%l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s==2 and e==3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of %s...",target))=]@@
\\
@@[= =][= =][=local current=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="%%%%STARTSCRIPTS%%
[[foldercontrol]]
[[folder:urlencode.lua]]
@@[=local urlencode=]=[={}=]@@
\\
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[= =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[= =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[= =][= =][=str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= =][= =][=--Convert spaces to plus signs=]@@
@@[= =][= =][=return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
\\
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
\\
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= =][= =][=--table of argument strings=]@@
@@[= =][= =][=local argts, i=]=[= {}, 1=]@@
@@[= =][= =][=for k, v in pairs(t) do=]@@
@@[= =][= =][= =][= =][=argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= =][= =][= =][= =][=i=]=[=i+1=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][=return table.concat(argts,'&')=]@@
@@[=end=]@@
\\
@@[=return urlencode=]@@
[[/folder]]
[[folder:tvtropes.lua]]
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
\\
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
\\
@@[=local tvtropes=]=[={}=]@@
\\
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
\\
@@[=local function fullname(page)=]@@
@@[= =][= =][=--Require pagename=]@@
@@[= =][= =][=assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= =][= =][=--If no namespace specified, assume Main=]@@
@@[= =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
\\
@@[= =][= =][=return page=]@@
@@[=end=]@@
\\
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=assert(type(body)=]=[==]=[="string","Page body required")=]@@
\\
@@[= =][= =][=local response =]=[==]@@
@@[= =][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[= =][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=action=]=[="post", post=]=[="save",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=pagename=]=[=page, text=]=[=body,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=author=]=[=author or "Anonymous",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=reason=]=[=reason or ""=]@@
@@[= =][= =][= =][= =][= =][= =][=})}=]@@
\\
@@[= =][= =][=--Error on any socket errors=]@@
@@[= =][= =][=assert(response[1=]][=,response[2=]][=)=]@@
\\
@@[= =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[= =][= =][=if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
@@[= =][= =][=else return true=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
\\
@@[= =][= =][=function html2plain(src)=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= =][= =][= =][= =][=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= =][= =][= =][= =][=return src=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
\\
@@[= =][= =][=page=]=[=fullname(page)=]@@
\\
@@[= =][= =][=local body, code =]=[= http.request(=]@@
@@[= =][= =][= =][= =][=authpageurl(page)..'?action=]=[=source')=]@@
\\
@@[= =][= =][=--Trigger error on socket failure=]@@
@@[= =][= =][=assert(body,code)=]@@
\\
@@[= =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[= =][= =][=return html2plain(body)=]@@
@@[=end=]@@
\\
@@[=return tvtropes=]@@
[[/folder]]
[[folder:tropersrepo.lua]]
@@[=--Script that posts the latest version of the TV Tropes=]@@
@@[=--scripts to my contributor page.=]@@
\\
@@[=--Any edit to the functionality of this script tends to generate=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
\\
@@[=local tvtropes =]=[= require "tvtropes"=]@@
\\
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
\\
@@[=local scripts=]=[={=]@@
@@[= =][= =][="urlencode.lua",=]@@
@@[= =][= =][="tvtropes.lua",=]@@
@@[= =][= =][="tropersrepo.lua",=]@@
@@[= =][= =][="arrdev_recap.lua",=]@@
@@[=}=]@@
\\
@@[=local function scriptfolder(name,script)=]@@
@@[= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= =][= =][= =][= =][=name,script)=]@@
@@[=end=]@@
\\
@@[=local function revsection()=]@@
@@[= =][= =][=local folders=]=[={=]@@
@@[= =][= =][= =][= =][="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= =][= =][= =][= =][="[[foldercontrol=]][==]][="=]@@
@@[= =][= =][=}=]@@
@@[= =][= =][=local headers=]=[=#folders=]@@
\\
@@[= =][= =][=for i=]=[=1, #scripts do=]@@
@@[= =][= =][= =][= =][=local slines=]=[={}=]@@
@@[= =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) do=]@@
\\
@@[= =][= =][= =][= =][= =][= =][=if line=]=[==]=[="" then=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= =][= =][= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=]=[=string.gsub(escaped,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =]=[==]][=[=]=[=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
\\
@@[= =][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=local content=]=[=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
\\
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=local function push(notes)=]@@
@@[= =][= =][=local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
\\
@@[= =][= =][=print(string.format("Getting current version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local current=]=[=tvtropes.get(target)=]@@
\\
@@[= =][= =][=local updated=]=[=string.gsub(current,=]@@
@@[= =][= =][= =][= =][="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of =]%[=s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps=]=[={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated=]=[={}=]@@
@@[= =][= =][=for s=]=[=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s=]][==]=[={}=]@@
@@[= =][= =][= =][= =][=for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s=]][=[e=]][= then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][= =][= =][=pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=]=[=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums=]=[={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids=]=[={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
\\
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=]=[=string.gsub(title,'=]%[=W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=]=[=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=]=[=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=]=[=1,#adeps[s=]][= do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
%%ENDSCRIPTS%%%%",=]@@
@@[= =][= =][= =][= =][=gssscripts)=]@@
\\
@@[= =][= =][=print(string.format("Posting new version of %s...",target))=]@@
\\
@@[= =][= =][=local posted=]@@
@@[= =][= =][=while not posted do=]@@
@@[= =][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[= =][= =][= =][= =][=if not posted then print" Retrying..." end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Executing code---------------------------------------------------------------=]@@
\\
@@[=push "bloody spaces"=]@@
\\
[[/folder]]
[[folder:arrdev_recap.lua]]
@@[=--encoding: UTF-8=]@@
\\
@@[=--Required to post pages=]@@
@@[=local tvtropes=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=require "urlencode"=]@@
\\
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps={=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="Pilot",=]@@
@@[= =][= =][= =][= =][="Top Banana",=]@@
@@[= =][= =][= =][= =][="Bringing Up Buster",=]@@
@@[= =][= =][= =][= =][="Key Decisions",=]@@
@@[= =][= =][= =][= =][="Visiting Ours",=]@@
@@[= =][= =][= =][= =][="Charity Drive",=]@@
@@[= =][= =][= =][= =][="My Mother, The Car",=]@@
@@[= =][= =][= =][= =][="In God We Trust",=]@@
@@[= =][= =][= =][= =][="Storming the Castle",=]@@
@@[= =][= =][= =][= =][="Pier Pressure",=]@@
@@[= =][= =][= =][= =][="Public Relations",=]@@
@@[= =][= =][= =][= =][="Marta Complex",=]@@
@@[= =][= =][= =][= =][="Beef Consommé",=]@@
@@[= =][= =][= =][= =][="Shock and Aww",=]@@
@@[= =][= =][= =][= =][="Staff Infection",=]@@
@@[= =][= =][= =][= =][="Missing Kitty",=]@@
@@[= =][= =][= =][= =][="Altar Egos",=]@@
@@[= =][= =][= =][= =][="Justice Is Blind",=]@@
@@[= =][= =][= =][= =][="Best Man for the GOB",=]@@
@@[= =][= =][= =][= =][="Whistler's Mother",=]@@
@@[= =][= =][= =][= =][="Not Without My Daughter",=]@@
@@[= =][= =][= =][= =][="Let 'Em Eat Cake"=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The One Where Michael Leaves",=]@@
@@[= =][= =][= =][= =][="The One Where They Build a House",=]@@
@@[= =][= =][= =][= =][="¡Amigos!",=]@@
@@[= =][= =][= =][= =][="Good Grief",=]@@
@@[= =][= =][= =][= =][="Sad Sack",=]@@
@@[= =][= =][= =][= =][="Afternoon Delight",=]@@
@@[= =][= =][= =][= =][="Switch Hitter",=]@@
@@[= =][= =][= =][= =][="Queen for a Day",=]@@
@@[= =][= =][= =][= =][="Burning Love",=]@@
@@[= =][= =][= =][= =][="Ready, Aim, Marry Me",=]@@
@@[= =][= =][= =][= =][="Out on a Limb",=]@@
@@[= =][= =][= =][= =][="Hand to God",=]@@
@@[= =][= =][= =][= =][="Motherboy XXX",=]@@
@@[= =][= =][= =][= =][="The Immaculate Election",=]@@
@@[= =][= =][= =][= =][="Sword of Destiny",=]@@
@@[= =][= =][= =][= =][="Meat the Veals",=]@@
@@[= =][= =][= =][= =][="Spring Breakout",=]@@
@@[= =][= =][= =][= =][="Righteous Brothers",=]@@
@@[= =][= =][=},=]@@
@@[= =][= =][={=]@@
@@[= =][= =][= =][= =][="The Cabin Show",=]@@
@@[= =][= =][= =][= =][="For British Eyes Only",=]@@
@@[= =][= =][= =][= =][="Forget-Me-Now",=]@@
@@[= =][= =][= =][= =][="Notapusy",=]@@
@@[= =][= =][= =][= =][="Mr. F",=]@@
@@[= =][= =][= =][= =][="The Ocean Walker",=]@@
@@[= =][= =][= =][= =][="Prison Break-In",=]@@
@@[= =][= =][= =][= =][="Making a Stand",=]@@
@@[= =][= =][= =][= =][="S.O.B.s",=]@@
@@[= =][= =][= =][= =][="Fakin' It",=]@@
@@[= =][= =][= =][= =][="Family Ties",=]@@
@@[= =][= =][= =][= =][="Exit Strategy",=]@@
@@[= =][= =][= =][= =][="Development Arrested"=]@@
@@[= =][= =][=},=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens={}=]@@
\\
@@[=do --wikipedia=]@@
@@[= =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[= =][= =][=local disambigeps={=]@@
@@[= =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[= =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[= =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--construct lookup table=]@@
@@[= =][= =][=local disambiguated={}=]@@
@@[= =][= =][=for s=1,#disambigeps do=]@@
@@[= =][= =][= =][= =][=disambiguated[s]={}=]@@
@@[= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
\\
@@[= =][= =][=--Function that returns the Wikipedia URL=]@@
@@[= =][= =][=function tokens.wikipedia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[= =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[= =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[= =][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
@@[= =][= =][= =][= =][=end=]@@
\\
@@[= =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= =][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[= =][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[= =][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[= =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
\\
@@[=do --Balboa Observer-Picayune=]@@
@@[= =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[= =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
\\
@@[= =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[= =][= =][=function tokens.theop(s,e)=]@@
@@[= =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[= =][= =][= =][= =][=if s==1 then e = s1flips[e] or e end=]@@
@@[= =][= =][= =][= =][=return string.format("http://the-op.com/episode/%i%02i",s,e)=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= =][= =][=--that I have to use you=]@@
@@[= =][= =][=local ttnums={=]@@
@@[= =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[= =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[= =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[= =][= =][=function tokens.imdb(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt%07i/",ttnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Hulu, you know, just in case=]@@
@@[= =][= =][=local watchnums={=]@@
@@[= =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[= =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[= =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.hulu(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=do --Netflix Watch Instantly=]@@
@@[= =][= =][=--It's largely sequential, but not quite.=]@@
@@[= =][= =][=--I printed out all the numbers and moved them around=]@@
@@[= =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[= =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= =][= =][=local movieids={=]@@
@@[= =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[= =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[= =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[= =][= =][=}=]@@
\\
@@[= =][= =][=function tokens.netflix(s,e)=]@@
@@[= =][= =][= =][= =][=return string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=%i",movieids[s][e])=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= =][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia]] -- [[$wikia Wikia]] -- [[$theop Balboa Observer-Picayune]] -- [[$imdb IMDB]]=]@@
\\
@@[=Watch now: [[$hulu Hulu]] -- [[$netflix Netflix]]=]@@
@@[=----=]@@
@@[=%%ENDLINKS%%=]@@
@@[=]=]=]@@
@@[= =][= =][=function ad_ep_links(s,e)=]@@
@@[= =][= =][= =][= =][=return (string.gsub(template,"%$(%w+)",function(token) return tokens[token](s,e) end))=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= =][= =][=--get the ep title=]@@
@@[= =][= =][=local title=adeps[s][e]=]@@
@@[= =][= =][=--replace the é in Beef Consommé=]@@
@@[= =][= =][=title=string.gsub(title,'é','e')=]@@
@@[= =][= =][=--transform to CamelCased WikiWord=]@@
@@[= =][= =][=title=string.gsub(title,' (%l?)',string.upper)=]@@
@@[= =][= =][=--Remove all non-alphanumeric characters=]@@
@@[= =][= =][=title=string.gsub(title,'%W','')=]@@
\\
@@[= =][= =][=return string.format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
@@[=end=]@@
\\
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= =][= =][=return tvtropes.post(=]@@
@@[= =][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[= =][= =][= =][= =][=string.format(=]@@
@@[= =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"%s\" provides examples of:\n\n",=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[= =][= =][= =][= =][="STUART",=]@@
@@[= =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
\\
@@[=local function update_links(reason)=]@@
@@[= =][= =][=return function(s,e)=]@@
@@[= =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[= =][= =][= =][= =][=if s==2 and e==3 then=]@@
@@[= =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= =][= =][= =][= =][=else=]@@
@@[= =][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[= =][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[= =][= =][= =][= =][= =][= =][=local gsubsafelinks = string.gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[= =][= =][= =][= =][= =][= =][=local success=]@@
@@[= =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=success, code = tvtropes.post(pagename,=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[= =][= =][= =][= =][= =][= =][=end=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
\\
@@[=local function for_all_eps(f)=]@@
@@[= =][= =][=for s=1,#adeps do=]@@
@@[= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[= =][= =][= =][= =][= =][= =][=print(string.format('Doing Season %i Episode %i, "%s"...',s,e,adeps[s][e]))=]@@
@@[= =][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[= =][= =][= =][= =][=end=]@@
@@[= =][= =][=end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
\\
@@[=--Okay, put your executing commands down here.=]@@
[[/folder]]
Is there an issue? Send a MessageReason:
bloody spaces
Changed line(s) 12 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
to:
@@[=local urlencode=]=[={}=]@@urlencode={}=]@@
Changed line(s) 16,24 (click to see context) from:
@@[= --Ensure all newlines are in CRLF form=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+ ")=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+ ")=]@@
to:
@@[= --Ensure =][= =][=--Ensure all newlines are in CRLF form=]@@
@@[=str =]=[= =][= =][=str = string.gsub (str, "\r?\n", "\r\n")=]@@
@@[=--Percent-encode =][= =][=--Percent-encode all non-unreserved characters=]@@
@@[=--as =][= =][=--as per RFC 3986, Section 2.3=]@@
@@[=--(except =][= =][=--(except for space, which gets plus-encoded)=]@@
@@[=str =]=[= =][= =][=str = string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
"([^%w%-%.%_%~ ])",=]@@
@@[=function =][= =][= =][= =][= =][= =][=function (c) return string.format ("=]%[==]%[==]%[=02X", ("%%%02X", string.byte(c)) end)=]@@
@@[=--Convert =][= =][=--Convert spaces to plus signs=]@@
@@[=return =][= =][=return string.gsub (str, " ", "+ ")=]@@"+")=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 28 (click to see context) from:
@@[=urlencode.string =]=[= encode=]@@
to:
@@[=urlencode.string =]=[= = encode=]@@
Changed line(s) 32,38 (click to see context) from:
@@[= --table of argument strings=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
to:
@@[= --table =][= =][=--table of argument strings=]@@
@@[=local =][= =][=local argts, i=]=[= i= {}, 1=]@@
@@[=for =][= =][=for k, v in pairs(t) do=]@@
@@[=argts[i=]][==]=[=encode(k).."=]=[="..=][= =][= =][= =][=argts[i]=encode(k).."="..encode(v)=]@@
@@[=i=]=[=i+ 1=]@@
=][= =][= =][= =][=i=i+1=]@@
@@[=end=]@@
=][= =][=end=]@@
@@[=return =][= =][=return table.concat(argts,'&')=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 46 (click to see context) from:
@@[=local http =]=[= require"socket.http"=]@@
to:
@@[=local http =]=[= = require"socket.http"=]@@
Changed line(s) 49 (click to see context) from:
@@[=local urlencode =]=[= require "urlencode"=]@@
to:
@@[=local urlencode =]=[= = require "urlencode"=]@@
Changed line(s) 51 (click to see context) from:
@@[=local tvtropes=]=[={}=]@@
to:
@@[=local tvtropes=]=[={}=]@@tvtropes={}=]@@
Changed line(s) 55 (click to see context) from:
@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
to:
@@[= return =][= =][=return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
Changed line(s) 59,62 (click to see context) from:
@@[= --Require pagename=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
to:
@@[= --Require =][= =][=--Require pagename=]@@
@@[=assert(type(page)=]=[==]=[="string","Destination =][= =][=assert(type(page)=="string","Destination page name required")=]@@
@@[=--If =][= =][=--If no namespace specified, assume Main=]@@
@@[=if =][= =][=if not string.find(page,'/') then page=]=[="Main/"..page="Main/"..page end=]@@
@@[=
@@[=
@@[=
Changed line(s) 64 (click to see context) from:
@@[= return page=]@@
to:
@@[= return =][= =][=return page=]@@
Changed line(s) 70 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@=][= =][=page=fullname(page)=]@@
Changed line(s) 72 (click to see context) from:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
to:
@@[= assert(type(body)=]=[==]=[="string","Page =][= =][=assert(type(body)=="string","Page body required")=]@@
Changed line(s) 74,81 (click to see context) from:
@@[= local response =]=[==]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
to:
@@[= local =][= =][=local response =]=[==]@@
==]@@
@@[={http.=][= =][= =][= =][={http.request(authpageurl(page),=]@@
@@[=urlencode.=][= =][= =][= =][= =][= =][=urlencode.table{=]@@
@@[=action=]=[="post", post=]=[="save",=]@@
=][= =][= =][= =][= =][= =][= =][= =][=action="post", post="save",=]@@
@@[=pagename=]=[=page, text=]=[=body,=]@@
=][= =][= =][= =][= =][= =][= =][= =][=pagename=page, text=body,=]@@
@@[=author=]=[=author =][= =][= =][= =][= =][= =][= =][= =][=author=author or "Anonymous",=]@@
@@[=reason=]=[=reason =][= =][= =][= =][= =][= =][= =][= =][=reason=reason or ""=]@@
@@[=})}=]@@=][= =][= =][= =][= =][= =][=})}=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 83,84 (click to see context) from:
@@[= --Error on any socket errors=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
to:
@@[= --Error =][= =][=--Error on any socket errors=]@@
@@[=assert(response[1=]][=,response[2=]][=)=]@@=][= =][=assert(response[1],response[2])=]@@
@@[=
Changed line(s) 86,91 (click to see context) from:
@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
to:
@@[= --If =][= =][=--If it doesn't return Found, return nil, the status, and the body:=]@@
@@[=--sometimes =][= =][=--sometimes it just rejects the password for some reason.=]@@
@@[=if tonumber(response[2=]][=)=]~[==]=[=302 =][= =][=if tonumber(response[2])~=302 then=]@@
@@[=return =][= =][= =][= =][=return nil, response[2=]][=, response[1=]][==]@@
response[2], response[1]=]@@
@@[=else =][= =][=else return true=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 98 (click to see context) from:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
to:
@@[= local =][= =][=local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@= {quot='"', amp='&', lt='<', gt='>'}=]@@
Changed line(s) 100,104 (click to see context) from:
@@[= function html2plain(src)=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
to:
@@[= function =][= =][=function html2plain(src)=]@@
@@[=src=]=[=string.=][= =][= =][= =][=src=string.gsub(src,"<br/>","\n")=]@@
@@[=src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
=][= =][= =][= =][=src=string.gsub(src,"&(%w-);",ents)=]@@
@@[=return =][= =][= =][= =][=return src=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
Changed line(s) 110 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@=][= =][=page=fullname(page)=]@@
Changed line(s) 112,113 (click to see context) from:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
to:
@@[= local =][= =][=local body, code =]=[= = http.request(=]@@
@@[=authpageurl(page)..'?action=]=[=source')=]@@=][= =][= =][= =][=authpageurl(page)..'?action=source')=]@@
@@[=
Changed line(s) 115,116 (click to see context) from:
@@[= --Trigger error on socket failure=]@@
@@[= assert(body,code)=]@@
@@[= assert(body,code)=]@@
to:
@@[= --Trigger =][= =][=--Trigger error on socket failure=]@@
@@[=assert(body,code)=]@@=][= =][=assert(body,code)=]@@
@@[=
Changed line(s) 118,119 (click to see context) from:
@@[= --Return the source converted back from the HTML conversion=]@@
@@[= return html2plain(body)=]@@
@@[= return html2plain(body)=]@@
to:
@@[= --Return =][= =][=--Return the source converted back from the HTML conversion=]@@
@@[=return =][= =][=return html2plain(body)=]@@
@@[=
Changed line(s) 132 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
to:
@@[=local tvtropes =]=[= = require "tvtropes"=]@@
Changed line(s) 134,135 (click to see context) from:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
to:
@@[=local target =]=[= = "Tropers/STUART"=]@@
@@[=localuser=]=[="STUART"=]@@user="STUART"=]@@
@@[=local
Changed line(s) 137,141 (click to see context) from:
@@[=local scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
to:
@@[=local scripts=]=[={=]@@
scripts={=]@@
@@[="urlencode.=][= =][="urlencode.lua",=]@@
@@[="tvtropes.=][= =][="tvtropes.lua",=]@@
@@[="tropersrepo.=][= =][="tropersrepo.lua",=]@@
@@[="arrdev_recap.=][= =][="arrdev_recap.lua",=]@@
@@[=
@@[=
@@[=
@@[=
Changed line(s) 145,147 (click to see context) from:
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
to:
@@[= return =][= =][=return string.format(=]@@
@@[="[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
=][= =][= =][= =][="[[folder:%s]]\n%s\n[[/folder]]",=]@@
@@[=name,script)=]@@=][= =][= =][= =][=name,script)=]@@
@@[=
@@[=
Changed line(s) 151,155 (click to see context) from:
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
to:
@@[= local folders=]=[={=]@@
=][= =][=local folders={=]@@
@@[="=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
=][= =][= =][= =][="%%STARTSCRIPTS%%",=]@@
@@[="[[foldercontrol=]][==]][="=]@@
=][= =][= =][= =][="[[foldercontrol]]"=]@@
@@[=}=]@@
=][= =][=}=]@@
@@[=local headers=]=[=#folders=]@@=][= =][=local headers=#folders=]@@
@@[=
@@[=
@@[=
@@[=
Changed line(s) 157,159 (click to see context) from:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
to:
@@[= for i=]=[=1, =][= =][=for i=1, #scripts do=]@@
@@[=local slines=]=[={}=]@@
=][= =][= =][= =][=local slines={}=]@@
@@[=for =][= =][= =][= =][=for line in io.lines(scripts[i=]][=) lines(scripts[i]) do=]@@
@@[=
@@[=
Changed line(s) 161,166 (click to see context) from:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
to:
@@[= if line=]=[==]=[="" =][= =][= =][= =][= =][= =][=if line=="" then=]@@
@@[=slines[#slines+ 1=]][==]=[='\\\\'=]@@
=][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]='\\\\'=]@@
@@[=else=]@@
=][= =][= =][= =][= =][= =][=else=]@@
@@[=--escape =][= =][= =][= =][= =][= =][= =][= =][=--escape all equals signs and percents=]@@
@@[=local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
=][= =][= =][= =][= =][= =][= =][= =][=local escaped=string.gsub(line,"[%~%=%]%%]",=]@@
@@[=function(char) return =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=function(char)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@format("=]&#%i;[=",string.byte(char))=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
Changed line(s) 168,170 (click to see context) from:
@@[= slines[#slines+ 1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= slines[#slines+ 1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
=][= =][= =][= =][= =][= =][= =][= =][=--do I hate this? yes, I do.=]@@
@@[=end=]@@
=][= =][= =][= =][= =][= =][= =][= =][=--escape _every_ _single_ _space_ at the start of a line=]@@
@@[=end=]@@=][= =][= =][= =][= =][= =][= =][= =][=--to keep them from being folded on commit=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(line,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =][=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
@@[=
@@[=
@@[= =][= =][= =][= =][= =][= =][= =][= =][=escaped=string.gsub(line,"^ *",function(s)=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][= =][= =][=return string.gsub(s," "," =][=")=]@@
@@[= =][= =][= =][= =][= =][= =][= =][= =][=end)=]@@
Changed line(s) 172,174 (click to see context) from:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
to:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
=][= =][= =][= =][= =][= =][= =][= =][=slines[#slines+1]=string.format("@@[=%s=]@@",escaped)=]@@
@@[=folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
=][= =][= =][= =][= =][= =][=end=]@@
@@[=end=]@@=][= =][= =][= =][=end=]@@
@@[=
@@[=
Changed line(s) 176 (click to see context) from:
@@[= folders[#folders+ 1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= folders[#folders+ 1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@=][= =][= =][= =][=local content=table.concat(slines,'\n')=]@@
@@[= =][= =][= =][= =][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@
@@[= =][= =][=end=]@@
@@[= =][= =][= =][= =][=folders[i+headers]=scriptfolder(scripts[i],content)=]@@
@@[= =][= =][=end=]@@
Changed line(s) 178,179 (click to see context) from:
@@[= return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
@@[=end=]@@
to:
@@[= return table.concat(folders,"\n\n")=]@@
@@[=end=]@@=][= =][=folders[#folders+1]="%%ENDSCRIPTS%%"=]@@
@@[=end=]@@
@@[= =][= =][=return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
\\
@@[=end=]@@
\\
Changed line(s) 182 (click to see context) from:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@=][= =][=local gssscripts=string.gsub(revsection(),"%%","%%%%")=]@@
Changed line(s) 184 (click to see context) from:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
to:
@@[= print(string.=][= =][=print(string.format("Getting current version of =]%[=s...%s...",target))=]@@
Changed line(s) 186 (click to see context) from:
@@[= local current=]=[=tvtropes.get(target)=]@@
to:
@@[= local current=]=[=tvtropes.=][= =][=local current=tvtropes.get(target)=]@@
Changed line(s) 188,190 (click to see context) from:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
to:
@@[= local updated=]=[=string.=][= =][=local updated=string.gsub(current,=]@@
@@[="=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
=][= =][= =][= =][="%%%%STARTSCRIPTS%%%%.-%%%%ENDSCRIPTS%%%%",=]@@
@@[=gssscripts)=]@@=][= =][= =][= =][=gssscripts)=]@@
@@[=
@@[=
Changed line(s) 192 (click to see context) from:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
to:
@@[= print(string.=][= =][=print(string.format("Posting new version of =]%[=s...%s...",target))=]@@
Changed line(s) 194,198 (click to see context) from:
@@[= local posted=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
to:
@@[= local =][= =][=local posted=]@@
@@[=while =][= =][=while not posted do=]@@
@@[=posted=]=[=tvtropes.=][= =][= =][= =][=posted=tvtropes.post(target,updated,user,notes)=]@@
@@[=if =][= =][= =][= =][=if not posted then print" print" Retrying..." end=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
Changed line(s) 203 (click to see context) from:
@@[=push "OK, think I got it now"=]@@
to:
@@[=push "OK, think I got it now"=]@@"bloody spaces"=]@@
Deleted line(s) 205 (click to see context) :
\\
Changed line(s) 212 (click to see context) from:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
to:
@@[=local tvtropes=]=[=require tvtropes=require "tvtropes"=]@@
Changed line(s) 214 (click to see context) from:
@@[=local urlencode=]=[=require "urlencode"=]@@
to:
@@[=local urlencode=]=[=require urlencode=require "urlencode"=]@@
Changed line(s) 217,276 (click to see context) from:
@@[=adeps=]=[={=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
to:
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 281 (click to see context) from:
@@[=local tokens=]=[={}=]@@
to:
@@[=local tokens=]=[={}=]@@tokens={}=]@@
Changed line(s) 284,290 (click to see context) from:
@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
to:
@@[= --Numbers =][= =][=--Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[=--whose =][= =][=--whose article titles end with "(Arrested Development)"=]@@
@@[=local disambigeps=]=[={=]@@
=][= =][=local disambigeps={=]@@
@@[={1,2,8,11,20,21,22}, =][= =][= =][= =][={1,2,8,11,20,21,22}, --Season 1=]@@
@@[={5,6,8,9,11,12,18}, =][= =][= =][= =][={5,6,8,9,11,12,18}, --Season 2=]@@
@@[={10,11,12} =][= =][= =][= =][={10,11,12} --Season 3=]@@
@@[=}=]@@=][= =][=}=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 292,299 (click to see context) from:
@@[= --construct lookup table=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= --construct =][= =][=--construct lookup table=]@@
@@[=local disambiguated=]=[={}=]@@
=][= =][=local disambiguated={}=]@@
@@[=for s=]=[=1,#disambigeps =][= =][=for s=1,#disambigeps do=]@@
@@[=disambiguated[s=]][==]=[={}=]@@
=][= =][= =][= =][=disambiguated[s]={}=]@@
@@[=for i=]=[=1,#disambigeps[s=]][= =][= =][= =][= =][=for i=1,#disambigeps[s] do=]@@
@@[=disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
=][= =][= =][= =][= =][= =][=disambiguated[s][disambigeps[s][i]]=true=]@@
@@[=end=]@@
=][= =][= =][= =][=end=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 301,312 (click to see context) from:
@@[= --Function that returns the Wikipedia URL=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
to:
@@[= --Function =][= =][=--Function that returns the Wikipedia URL=]@@
@@[=function =][= =][=function tokens.wikipedia(s,e)=]@@
@@[=local pagename=]=[=adeps[s=]][=[e=]][==]@@
=][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[=pagename=]=[=string.=][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[=pagename=]=[=urlencode.=][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[=if disambiguated[s=]][=[e=]][= =][= =][= =][= =][=if disambiguated[s][e] then=]@@
@@[=--Technically, =][= =][= =][= =][= =][= =][=--Technically, parentheses don't have to be percent-encoded=]@@
@@[=--for =][= =][= =][= =][= =][= =][=--for HTTP URIs because they're unused sub-delims=]@@
@@[=--per =][= =][= =][= =][= =][= =][=--per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[=--the =][= =][= =][= =][= =][= =][=--the function that percent-encodes all sub-delims=]@@
@@[=pagename=]=[=pagename..=][= =][= =][= =][= =][= =][=pagename=pagename.."_(Arrested_Development)"=]@@
@@[=end=]@@=][= =][= =][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 314,315 (click to see context) from:
@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= return =][= =][= =][= =][=return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
Changed line(s) 320,323 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
to:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
=][= =][= =][= =][=local pagename=adeps[s][e]=]@@
@@[=pagename=]=[=string.=][= =][= =][= =][=pagename=string.gsub(pagename,' ','_')=]@@
@@[=pagename=]=[=urlencode.=][= =][= =][= =][=pagename=urlencode.string(pagename)=]@@
@@[=return =][= =][= =][= =][=return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=
@@[=
@@[=
Changed line(s) 327,328 (click to see context) from:
@@[= --Season 1 episodes that are listed at different numbers=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
to:
@@[= --Season =][= =][=--Season 1 episodes that are listed at different numbers=]@@
@@[=local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 =][= =][=local s1flips={ [5]=6, [6]=5, [7]=8, [8]=7, [16]=18, [17]=16, [18]=17 }=]@@
@@[=
Changed line(s) 330,335 (click to see context) from:
@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
to:
@@[= --Function =][= =][=--Function the returns the URL of the episode's page on the-op.com=]@@
@@[=function =][= =][=function tokens.theop(s,e)=]@@
@@[=--correct =][= =][= =][= =][=--correct OutOfOrder Season 1 episodes=]@@
@@[=if s=]=[==]=[=1 =][= =][= =][= =][=if s==1 then e =]=[= s1flips[e=]][= = s1flips[e] or e end=]@@
@@[=return =][= =][= =][= =][=return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
com/episode/%i%02i",s,e)=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 339,354 (click to see context) from:
@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
to:
@@[= --why =][= =][=--why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[=--that =][= =][=--that I have to use you=]@@
@@[=local ttnums=]=[={=]@@
=][= =][=local ttnums={=]@@
@@[={ =][= =][= =][= =][={ 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[=0515214, =][= =][= =][= =][= =][= =][=0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[=0515238, =][= =][= =][= =][= =][= =][=0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[=0515228, =][= =][= =][= =][= =][= =][=0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[=0515232, =][= =][= =][= =][= =][= =][=0515232, 0515224, },=]@@
@@[={ =][= =][= =][= =][={ 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[=0515207, =][= =][= =][= =][= =][= =][=0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[=0515234, =][= =][= =][= =][= =][= =][=0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[=0515227, =][= =][= =][= =][= =][= =][=0515227, 0515245, 0515241, },=]@@
@@[={ =][= =][= =][= =][={ 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[=0515252, =][= =][= =][= =][= =][= =][=0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[=0515217, =][= =][= =][= =][= =][= =][=0515217, 0515215, 0757386, }=]@@
@@[=}=]@@=][= =][=}=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 356,359 (click to see context) from:
@@[= --Function that returns the URL for the episode's IMDB page=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
@@[= --Function =][= =][=--Function that returns the URL for the episode's IMDB page=]@@
@@[=function =][= =][=function tokens.imdb(s,e)=]@@
@@[=return =][= =][= =][= =][=return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
com/title/tt%07i/",ttnums[s][e])=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
Changed line(s) 363,376 (click to see context) from:
@@[= local watchnums=]=[={=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
to:
@@[= local watchnums=]=[={=]@@
=][= =][=local watchnums={=]@@
@@[={ 589, 1786, 585, 1781, =][= =][= =][= =][={ 589, 1786, 585, 1781, 1785,=]@@
@@[=580, 590, 588, 586, =][= =][= =][= =][= =][= =][= =][= =][= =][=580, 590, 588, 586, 575,=]@@
@@[=576, 579, 577, 644, =][= =][= =][= =][= =][= =][= =][= =][= =][=576, 579, 577, 644, 1783,=]@@
@@[=591, 582, 584, 578, =][= =][= =][= =][= =][= =][= =][= =][= =][=591, 582, 584, 578, 581,=]@@
@@[=583, =][= =][= =][= =][= =][= =][= =][= =][= =][=583, 587},=]@@
@@[={ 6641, 6644, 6643, 6638, =][= =][= =][= =][={ 6641, 6644, 6643, 6638, 6639,=]@@
@@[=12883, =][= =][= =][= =][= =][= =][= =][=12883, 13226, 12561, 12609, 12298,=]@@
@@[=12271, =][= =][= =][= =][= =][= =][= =][=12271, 12901, 13248, 13267, 13276,=]@@
@@[=13206, =][= =][= =][= =][= =][= =][= =][=13206, 12232, 12532},=]@@
@@[={ 6640, 6642, 6635, 6636, =][= =][= =][= =][={ 6640, 6642, 6635, 6636, 6637,=]@@
@@[=12497, =][= =][= =][= =][= =][= =][= =][=12497, 17189, 12523, 13139, 12225,=]@@
@@[=12317, =][= =][= =][= =][= =][= =][= =][=12317, 12194, 12215},=]@@
@@[=}=]@@=][= =][=}=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 378,381 (click to see context) from:
@@[= function tokens.hulu(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
@@[= function =][= =][=function tokens.hulu(s,e)=]@@
@@[=return =][= =][= =][= =][=return string.format(=]@@
@@[="http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
=][= =][= =][= =][= =][= =][="http://hulu.com/watch/%i", watchnums[s][e])=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
Changed line(s) 385,402 (click to see context) from:
@@[= --It's largely sequential, but not quite.=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
to:
@@[= --It's =][= =][=--It's largely sequential, but not quite.=]@@
@@[=--I =][= =][=--I printed out all the numbers and moved them around=]@@
@@[=--to =][= =][=--to fit the correct order (which is both inconsistent=]@@
@@[=--in =][= =][=--in IDs to Netflix order and Netflix to DVD order).=]@@
@@[=local movieids=]=[={=]@@
=][= =][=local movieids={=]@@
@@[={ =][= =][= =][= =][={ 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[=70133678, =][= =][= =][= =][= =][= =][=70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[=70133683, =][= =][= =][= =][= =][= =][=70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[=70133688, =][= =][= =][= =][= =][= =][=70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[=70133693, =][= =][= =][= =][= =][= =][=70133693, 70133694, },=]@@
@@[={ =][= =][= =][= =][={ 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[=70133700, =][= =][= =][= =][= =][= =][=70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[=70133705, =][= =][= =][= =][= =][= =][=70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[=70133709, =][= =][= =][= =][= =][= =][=70133709, 70133710, 70133712, },=]@@
@@[={ =][= =][= =][= =][={ 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[=70133718, =][= =][= =][= =][= =][= =][=70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[=70133723, =][= =][= =][= =][= =][= =][=70133723, 70133724, 70133725, }=]@@
@@[=}=]@@=][= =][=}=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 404,407 (click to see context) from:
@@[= function tokens.netflix(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
@@[= function =][= =][=function tokens.netflix(s,e)=]@@
@@[=return =][= =][= =][= =][=return string.format(=]@@
@@[="http://www.=][= =][= =][= =][= =][= =][="http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
com/WiPlayer?movieid=%i",movieids[s][e])=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
Changed line(s) 415,416 (click to see context) from:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
to:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@=][= =][=local template=[=[=]@@
@@[=%%STARTLINKS%%=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=%%STARTLINKS%%=]@@
Changed line(s) 418 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= Wikipedia]] -- [[$wikia Wikia=]][==]][= Wikia]] -- [[$theop Balboa Observer-Picayune=]][==]][= Observer-Picayune]] -- [[$imdb IMDB=]][==]][==]@@IMDB]]=]@@
Changed line(s) 420 (click to see context) from:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
to:
@@[=Watch now: [[$hulu Hulu=]][==]][= Hulu]] -- [[$netflix Netflix=]][==]][==]@@Netflix]]=]@@
Changed line(s) 422,426 (click to see context) from:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
to:
@@[==]][==]=[==]][==]@@
@@[=]=]=]@@
@@[=
@@[=
@@[=
Changed line(s) 431,438 (click to see context) from:
@@[= --get the ep title=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
to:
@@[= --get =][= =][=--get the ep title=]@@
@@[=local title=]=[=adeps[s=]][=[e=]][==]@@
=][= =][=local title=adeps[s][e]=]@@
@@[=--replace =][= =][=--replace the é in Beef Consommé=]@@
@@[=title=]=[=string.=][= =][=title=string.gsub(title,'é','e')=]@@
@@[=--transform =][= =][=--transform to CamelCased WikiWord=]@@
@@[=title=]=[=string.=][= =][=title=string.gsub(title,' (=]%[=l?)',string.(%l?)',string.upper)=]@@
@@[=--Remove =][= =][=--Remove all non-alphanumeric characters=]@@
@@[=title=]=[=string.gsub(title,'=]%[=W','')=]@@=][= =][=title=string.gsub(title,'%W','')=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 440 (click to see context) from:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
to:
@@[= return =][= =][=return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@format("Recap/ArrestedDevelopmentS%iE%i%s",s,e,title)=]@@
Changed line(s) 444,450 (click to see context) from:
@@[= return tvtropes.post(=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
to:
@@[= return =][= =][=return tvtropes.post(=]@@
@@[=recap_pagename(s,e),=]@@
=][= =][= =][= =][=recap_pagename(s,e),=]@@
@@[=string.=][= =][= =][= =][=string.format(=]@@
@@[="\n\n=]%[=s\n!The =][= =][= =][= =][= =][= =][="\n\n%s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" \"%s\" provides examples of:\n\n",=]@@
@@[=ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
=][= =][= =][= =][= =][= =][= =][= =][=ad_ep_links(s,e),adeps[s][e]),=]@@
@@[="STUART",=]@@
=][= =][= =][= =][="STUART",=]@@
@@[="Adding =][= =][= =][= =][="Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 454,471 (click to see context) from:
@@[= return function(s,e)=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= return =][= =][=return function(s,e)=]@@
@@[=--until =][= =][= =][= =][=--until comment syntax is changed, Amigos is manual-only=]@@
@@[=if s=]=[==]=[=2 =][= =][= =][= =][=if s==2 and e=]=[==]=[=3 e==3 then=]@@
@@[=print =][= =][= =][= =][= =][= =][=print "(Skipping Amigos because the links go all screwy)"=]@@
@@[=else=]@@
=][= =][= =][= =][=else=]@@
@@[=local pagename=]=[=recap_pagename(s,e)=]@@
=][= =][= =][= =][= =][= =][=local pagename=recap_pagename(s,e)=]@@
@@[=local pageasis=]=[=tvtropes.=][= =][= =][= =][= =][= =][=local pageasis=tvtropes.get(pagename)=]@@
@@[=local =][= =][= =][= =][= =][= =][=local gsubsafelinks =]=[= = string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
gsub(ad_ep_links(s,e),"%%","%%%%")=]@@
@@[=local =][= =][= =][= =][= =][= =][=local success=]@@
@@[=while =][= =][= =][= =][= =][= =][=while not success do=]@@
@@[=local =][= =][= =][= =][= =][= =][= =][= =][=local code=]@@
@@[=success, =][= =][= =][= =][= =][= =][= =][= =][=success, code =]=[= = tvtropes.post(pagename,=]@@
@@[=string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
=][= =][= =][= =][= =][= =][= =][= =][= =][= =][=string.gsub(pageasis,"%%%%STARTLINKS%%%%.-%%%%ENDLINKS%%%%",gsubsafelinks),=]@@
@@[="STUART",reason)=]@@
=][= =][= =][= =][= =][= =][= =][= =][= =][= =][="STUART",reason)=]@@
@@[=if =][= =][= =][= =][= =][= =][= =][= =][=if not success then print("Retrying... "..code) end=]@@
@@[=end=]@@
=][= =][= =][= =][= =][= =][=end=]@@
@@[=end=]@@
=][= =][= =][= =][=end=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
@@[=
Changed line(s) 475,480 (click to see context) from:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= for s=]=[=1,#adeps =][= =][=for s=1,#adeps do=]@@
@@[=for e=]=[=1,#adeps[s=]][= =][= =][= =][= =][=for e=1,#adeps[s] do=]@@
@@[=print(string.=][= =][= =][= =][= =][= =][=print(string.format('Doing Season =]%[=i %i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
%i, "%s"...',s,e,adeps[s][e]))=]@@
@@[=f(s,e)=]@@
=][= =][= =][= =][= =][= =][=f(s,e)=]@@
@@[=end=]@@
=][= =][= =][= =][=end=]@@
@@[=end=]@@=][= =][=end=]@@
@@[=
@@[=
@@[=
@@[=
@@[=
Is there an issue? Send a MessageReason:
None
Changed line(s) 20 (click to see context) from:
@@[= --(except for space, which gets plus-encoded)=]@@
to:
@@[= --(except for space, which gets gets plus-encoded)=]@@
Is there an issue? Send a MessageReason:
None
Changed line(s) 20 (click to see context) from:
@@[= --(except for space, which gets plus-encoded)=]@@
to:
@@[= --(except for space, which gets gets plus-encoded)=]@@
Is there an issue? Send a MessageReason:
None
Changed line(s) 16 (click to see context) from:
@@[= =][=--Ensure all newlines are in CRLF form=]@@
to:
@@[= =][=--Ensure --Ensure all newlines are in CRLF form=]@@
Is there an issue? Send a MessageReason:
None
Changed line(s) 16 (click to see context) from:
@@[= =][= =][=--Ensure all newlines are in CRLF form=]@@
to:
Is there an issue? Send a MessageReason:
None
Changed line(s) 16 (click to see context) from:
@@[= =][= =]--Ensure all newlines are in CRLF form=]@@
to:
@@[= =][= =]--Ensure =][=--Ensure all newlines are in CRLF form=]@@
Is there an issue? Send a MessageReason:
None
Changed line(s) 16 (click to see context) from:
@@[= --Ensure all newlines are in CRLF form=]@@
to:
@@[= --Ensure =][= =]--Ensure all newlines are in CRLF form=]@@
Is there an issue? Send a MessageReason:
None
Changed line(s) 493,509 (click to see context) from:
* ArrestedDevelopment
* {{Blackadder}} (including ''Back and Forth'')
* TheCritic
* DeadLikeMe (not including ''Life After Death'')
* {{Dollhouse}}
* {{Firefly}}
* [[{{Freakazoid}} Freakazoid!]]
* {{Futurama}} (up through the four movies)
* GilligansIsland
* LifeOnMars (the British one, obviously)
* LookAroundYou
* PeepShow
* PoliceSquad
* PushingDaisies
* {{Spaced}}
* TheWire
* {{Blackadder}} (including ''Back and Forth'')
* TheCritic
* DeadLikeMe (not including ''Life After Death'')
* {{Dollhouse}}
* {{Firefly}}
* [[{{Freakazoid}} Freakazoid!]]
* {{Futurama}} (up through the four movies)
* GilligansIsland
* LifeOnMars (the British one, obviously)
* LookAroundYou
* PeepShow
* PoliceSquad
* PushingDaisies
* {{Spaced}}
* TheWire
to:
* TheWire
Changed line(s) 511,513 (click to see context) from:
* TheATeam (through season one)
* {{Reaper}} (through season one)
* {{Reaper}} (through season one)
to:
* [[{{Reno911}} Reno 911!]]
Changed line(s) 515,516 (click to see context) from:
* {{Community}} (one season)
* {{Archer}} (one season)
* {{Archer}} (one season)
to:
Is there an issue? Send a MessageReason:
None
Changed line(s) 3,4 (click to see context) from:
Use Tropers/STUARTDiscussion to talk to me, and maybe [[http://tvtropes.org/pmwiki/wiki_pm.php send a PM]] to notify.
to:
Use Tropers/STUARTDiscussion to talk to me, and maybe [[http://tvtropes.org/pmwiki/wiki_pm.php send a PM]] PM (that little envelope icon next to notify.
"Contributor's Page") to notify so I know you did.
Changed line(s) 12 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
to:
@@[=local urlencode=]=[={}=]@@
Changed line(s) 17 (click to see context) from:
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
to:
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
Changed line(s) 21,22 (click to see context) from:
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
to:
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
Changed line(s) 28 (click to see context) from:
@@[=urlencode.string =]=[= encode=]@@
to:
@@[=urlencode.string =]=[= encode=]@@
Changed line(s) 33 (click to see context) from:
@@[= local argts, i=]=[= {}, 1=]@@
to:
@@[= local argts, i=]=[= {}, 1=]@@
Changed line(s) 35,36 (click to see context) from:
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= i=]=[=i+ 1=]@@
to:
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= i=]=[=i+ 1=]@@
Changed line(s) 46 (click to see context) from:
@@[=local http =]=[= require"socket.http"=]@@
to:
@@[=local http =]=[= require"socket.http"=]@@
Changed line(s) 49 (click to see context) from:
@@[=local urlencode =]=[= require "urlencode"=]@@
to:
@@[=local urlencode =]=[= require "urlencode"=]@@
Changed line(s) 51 (click to see context) from:
@@[=local tvtropes=]=[={}=]@@
to:
@@[=local tvtropes=]=[={}=]@@
Changed line(s) 60 (click to see context) from:
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
to:
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
Changed line(s) 62 (click to see context) from:
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
to:
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
Changed line(s) 70 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@
Changed line(s) 72 (click to see context) from:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
to:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
Changed line(s) 74 (click to see context) from:
@@[= local response =]=[==]@@
to:
@@[= local response =]=[==]@@
Changed line(s) 77,80 (click to see context) from:
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
to:
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
Changed line(s) 84 (click to see context) from:
@@[= assert(response[1=]][=,response[2=]][=)=]@@
to:
@@[= assert(response[1=]][=,response[2=]][=)=]@@
Changed line(s) 88,89 (click to see context) from:
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
to:
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
Changed line(s) 98 (click to see context) from:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
to:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
Changed line(s) 101,102 (click to see context) from:
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
to:
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
Changed line(s) 110 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@
Changed line(s) 112,113 (click to see context) from:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
to:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
Changed line(s) 132 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
to:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
Changed line(s) 134,135 (click to see context) from:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
to:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
Changed line(s) 137 (click to see context) from:
@@[=local scripts=]=[={=]@@
to:
@@[=local scripts=]=[={=]@@
Changed line(s) 146 (click to see context) from:
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
to:
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
Changed line(s) 151,153 (click to see context) from:
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
to:
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
Changed line(s) 155 (click to see context) from:
@@[= local headers=]=[=#folders=]@@
to:
@@[= local headers=]=[=#folders=]@@
Changed line(s) 157,159 (click to see context) from:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
to:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
Changed line(s) 161,162 (click to see context) from:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
to:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
Changed line(s) 165,166 (click to see context) from:
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
to:
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
Changed line(s) 168 (click to see context) from:
@@[= slines[#slines+ 1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
to:
@@[= slines[#slines+ 1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
Changed line(s) 172,173 (click to see context) from:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
to:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
Changed line(s) 176 (click to see context) from:
@@[= folders[#folders+ 1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= folders[#folders+ 1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
Changed line(s) 182 (click to see context) from:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 184 (click to see context) from:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
to:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
Changed line(s) 186 (click to see context) from:
@@[= local current=]=[=tvtropes.get(target)=]@@
to:
@@[= local current=]=[=tvtropes.get(target)=]@@
Changed line(s) 188,189 (click to see context) from:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
to:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
Changed line(s) 192 (click to see context) from:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
to:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
Changed line(s) 196 (click to see context) from:
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
to:
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
Changed line(s) 212 (click to see context) from:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
to:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
Changed line(s) 214 (click to see context) from:
@@[=local urlencode=]=[=require "urlencode"=]@@
to:
@@[=local urlencode=]=[=require "urlencode"=]@@
Changed line(s) 217 (click to see context) from:
@@[=adeps=]=[={=]@@
to:
@@[=adeps=]=[={=]@@
Changed line(s) 281 (click to see context) from:
@@[=local tokens=]=[={}=]@@
to:
@@[=local tokens=]=[={}=]@@
Changed line(s) 286 (click to see context) from:
@@[= local disambigeps=]=[={=]@@
to:
@@[= local disambigeps=]=[={=]@@
Changed line(s) 293,297 (click to see context) from:
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
to:
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
Changed line(s) 303,306 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
to:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
Changed line(s) 311 (click to see context) from:
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
to:
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
Changed line(s) 320,322 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
to:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
Changed line(s) 328 (click to see context) from:
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
to:
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
Changed line(s) 333,334 (click to see context) from:
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
to:
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
Changed line(s) 341 (click to see context) from:
@@[= local ttnums=]=[={=]@@
to:
@@[= local ttnums=]=[={=]@@
Changed line(s) 358 (click to see context) from:
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
to:
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
Changed line(s) 363 (click to see context) from:
@@[= local watchnums=]=[={=]@@
to:
@@[= local watchnums=]=[={=]@@
Changed line(s) 380 (click to see context) from:
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
to:
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
Changed line(s) 389 (click to see context) from:
@@[= local movieids=]=[={=]@@
to:
@@[= local movieids=]=[={=]@@
Changed line(s) 406 (click to see context) from:
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
to:
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
Changed line(s) 415,416 (click to see context) from:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
to:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
Changed line(s) 418 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
Changed line(s) 420 (click to see context) from:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
to:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
Changed line(s) 422,423 (click to see context) from:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[==]][==]=[==]][==]@@
to:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[==]][==]=[==]][==]@@
Changed line(s) 425 (click to see context) from:
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
to:
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
Changed line(s) 432 (click to see context) from:
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
to:
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
Changed line(s) 434 (click to see context) from:
@@[= title=]=[=string.gsub(title,'é','e')=]@@
to:
@@[= title=]=[=string.gsub(title,'é','e')=]@@
Changed line(s) 436 (click to see context) from:
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
to:
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
Changed line(s) 438 (click to see context) from:
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
to:
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
Changed line(s) 440 (click to see context) from:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
to:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
Changed line(s) 447,448 (click to see context) from:
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
to:
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
Changed line(s) 456 (click to see context) from:
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
to:
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
Changed line(s) 459,461 (click to see context) from:
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 465,466 (click to see context) from:
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
to:
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
Changed line(s) 475,477 (click to see context) from:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
to:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
Is there an issue? Send a MessageReason:
OK, think I got it now
Changed line(s) 12 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
to:
@@[=local urlencode=]=[={}=]@@
Changed line(s) 16,24 (click to see context) from:
@@[= --Ensure all newlines are in CRLF form=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+ ")=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+ ")=]@@
to:
Changed line(s) 28 (click to see context) from:
@@[=urlencode.string =]=[= encode=]@@
to:
@@[=urlencode.string =]=[= encode=]@@
Changed line(s) 32,38 (click to see context) from:
@@[= --table of argument strings=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+ 1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
to:
@@[=
@@[= end=]@@
Changed line(s) 46 (click to see context) from:
@@[=local http =]=[= require"socket.http"=]@@
to:
@@[=local http =]=[= require"socket.http"=]@@
Changed line(s) 49 (click to see context) from:
@@[=local urlencode =]=[= require "urlencode"=]@@
to:
@@[=local urlencode =]=[= require "urlencode"=]@@
Changed line(s) 51 (click to see context) from:
@@[=local tvtropes=]=[={}=]@@
to:
@@[=local tvtropes=]=[={}=]@@
Changed line(s) 55 (click to see context) from:
@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
to:
Changed line(s) 59,62 (click to see context) from:
@@[= --Require pagename=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
to:
Changed line(s) 64 (click to see context) from:
@@[= return page=]@@
to:
Changed line(s) 70 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
Changed line(s) 72 (click to see context) from:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
to:
Changed line(s) 74,81 (click to see context) from:
@@[= local response =]=[==]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
to:
Changed line(s) 83,84 (click to see context) from:
@@[= --Error on any socket errors=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
to:
Changed line(s) 86,91 (click to see context) from:
@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
to:
Changed line(s) 98 (click to see context) from:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
to:
Changed line(s) 100,104 (click to see context) from:
@@[= function html2plain(src)=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
to:
Changed line(s) 110 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
Changed line(s) 112,113 (click to see context) from:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
to:
Changed line(s) 115,116 (click to see context) from:
@@[= --Trigger error on socket failure=]@@
@@[= assert(body,code)=]@@
@@[= assert(body,code)=]@@
to:
Changed line(s) 118,119 (click to see context) from:
@@[= --Return the source converted back from the HTML conversion=]@@
@@[= return html2plain(body)=]@@
@@[= return html2plain(body)=]@@
to:
Changed line(s) 126 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
to:
@@[=--scripts to my contributor page.=]@@
Changed line(s) 128,129 (click to see context) from:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
to:
@@[=local user=]=[="STUART"=]@@
@@[=--about fifteen or 20 edits to the page: see ProximalErrorProbability.=]@@
Changed line(s) 131,136 (click to see context) from:
@@[=local scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
to:
@@[=local scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@tvtropes =]=[= require "tvtropes"=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
Changed line(s) 138,142 (click to see context) from:
@@[=local function scriptfolder(name,script)=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
to:
@@[=local function scriptfolder(name,script)=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
@@[=local user=]=[="STUART"=]@@
Changed line(s) 144,149 (click to see context) from:
@@[=local function revsection()=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
to:
@@[=local function revsection()=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
Changed line(s) 151,153 (click to see context) from:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
to:
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
Changed line(s) 155,160 (click to see context) from:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
to:
@@[= slines[#slines+ 1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[=
@@[= local
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
Changed line(s) 162,164 (click to see context) from:
@@[= slines[#slines+ 1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
to:
@@[= end=]@@
@@[= end=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
Changed line(s) 166,168 (click to see context) from:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
to:
@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
@@[= local
@@[= folders[i+ headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
Changed line(s) 170 (click to see context) from:
@@[= folders[#folders+ 1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= end=]@@
@@[= end=]@@
Changed line(s) 172,173 (click to see context) from:
@@[= return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
@@[=end=]@@
to:
@@[=end=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
Changed line(s) 175,176 (click to see context) from:
@@[=local function push(notes)=]@@
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 178 (click to see context) from:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
to:
@@[=end=]@@
Changed line(s) 180 (click to see context) from:
@@[= local current=]=[=tvtropes.get(target)=]@@
to:
@@[= local
Changed line(s) 182,184 (click to see context) from:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
to:
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
Changed line(s) 186 (click to see context) from:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
to:
Changed line(s) 188,193 (click to see context) from:
@@[= local posted=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
to:
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
Changed line(s) 195 (click to see context) from:
@@[=--Executing code---------------------------------------------------------------=]@@
to:
Changed line(s) 197 (click to see context) from:
@@[=push "OK, think I got it now"=]@@
to:
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
@@[=--Executing code---------------------------------------------------------------=]@@
@@[=push "OK, think I got it now"=]@@
\\
\\
\\
\\
Changed line(s) 206 (click to see context) from:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
to:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
Changed line(s) 208 (click to see context) from:
@@[=local urlencode=]=[=require "urlencode"=]@@
to:
@@[=local urlencode=]=[=require "urlencode"=]@@
Changed line(s) 211,270 (click to see context) from:
@@[=adeps=]=[={=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
to:
@@[=adeps=]=[={=]@@
@@[= @@[= {=]@@
@@[= @@[= "Pilot",=]@@
@@[= @@[= "Top Banana",=]@@
@@[= @@[= "Bringing Up Buster",=]@@
@@[= @@[= "Key Decisions",=]@@
@@[= @@[= "Visiting Ours",=]@@
@@[= @@[= "Charity Drive",=]@@
@@[= @@[= "My Mother, The Car",=]@@
@@[= @@[= "In God We Trust",=]@@
@@[= @@[= "Storming the Castle",=]@@
@@[= @@[= "Pier Pressure",=]@@
@@[= @@[= "Public Relations",=]@@
@@[= @@[= "Marta Complex",=]@@
@@[= @@[= "Beef Consommé",=]@@
@@[= @@[= "Shock and Aww",=]@@
@@[= @@[= "Staff Infection",=]@@
@@[= @@[= "Missing Kitty",=]@@
@@[= @@[= "Altar Egos",=]@@
@@[= @@[= "Justice Is Blind",=]@@
@@[= @@[= "Best Man for the GOB",=]@@
@@[= @@[= "Whistler's Mother",=]@@
@@[= @@[= "Not Without My Daughter",=]@@
@@[= @@[= "Let 'Em Eat Cake"=]@@
@@[= @@[= },=]@@
@@[= @@[= {=]@@
@@[= @@[= "The One Where Michael Leaves",=]@@
@@[= @@[= "The One Where They Build a House",=]@@
@@[= @@[= "¡Amigos!",=]@@
@@[= @@[= "Good Grief",=]@@
@@[= @@[= "Sad Sack",=]@@
@@[= @@[= "Afternoon Delight",=]@@
@@[= @@[= "Switch Hitter",=]@@
@@[= @@[= "Queen for a Day",=]@@
@@[= @@[= "Burning Love",=]@@
@@[= @@[= "Ready, Aim, Marry Me",=]@@
@@[= @@[= "Out on a Limb",=]@@
@@[= @@[= "Hand to God",=]@@
@@[= @@[= "Motherboy XXX",=]@@
@@[= @@[= "The Immaculate Election",=]@@
@@[= @@[= "Sword of Destiny",=]@@
@@[= @@[= "Meat the Veals",=]@@
@@[= @@[= "Spring Breakout",=]@@
@@[= @@[= "Righteous Brothers",=]@@
@@[= @@[= },=]@@
@@[= @@[= {=]@@
@@[= @@[= "The Cabin Show",=]@@
@@[= @@[= "For British Eyes Only",=]@@
@@[= @@[= "Forget-Me-Now",=]@@
@@[= @@[= "Notapusy",=]@@
@@[= @@[= "Mr. F",=]@@
@@[= @@[= "The Ocean Walker",=]@@
@@[= @@[= "Prison Break-In",=]@@
@@[= @@[= "Making a Stand",=]@@
@@[= @@[= "S.O.B.s",=]@@
@@[= @@[= "Fakin' It",=]@@
@@[= @@[= "Family Ties",=]@@
@@[= @@[= "Exit Strategy",=]@@
@@[= @@[= "Development Arrested"=]@@
@@[= @@[= },=]@@
Changed line(s) 275 (click to see context) from:
@@[=local tokens=]=[={}=]@@
to:
@@[=local tokens=]=[={}=]@@
Changed line(s) 278,284 (click to see context) from:
@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
to:
Changed line(s) 286,293 (click to see context) from:
@@[= --construct lookup table=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
to:
Changed line(s) 295,306 (click to see context) from:
@@[= --Function that returns the Wikipedia URL=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
to:
Changed line(s) 308,309 (click to see context) from:
@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= end=]@@
@@[= end=]@@
to:
Changed line(s) 314,317 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
to:
Changed line(s) 321,322 (click to see context) from:
@@[= --Season 1 episodes that are listed at different numbers=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
to:
Changed line(s) 324,329 (click to see context) from:
@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
to:
Changed line(s) 333,348 (click to see context) from:
@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
to:
Changed line(s) 350,353 (click to see context) from:
@@[= --Function that returns the URL for the episode's IMDB page=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
Changed line(s) 357,370 (click to see context) from:
@@[= local watchnums=]=[={=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
to:
Changed line(s) 372,375 (click to see context) from:
@@[= function tokens.hulu(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
Changed line(s) 379,396 (click to see context) from:
@@[= --It's largely sequential, but not quite.=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
to:
Changed line(s) 398,401 (click to see context) from:
@@[= function tokens.netflix(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
to:
Changed line(s) 409,410 (click to see context) from:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
to:
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
Changed line(s) 412 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
Changed line(s) 414 (click to see context) from:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
to:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
Changed line(s) 416,420 (click to see context) from:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
to:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= @@[= function ad_ep_links(s,e)=]@@
@@[= @@[= return (string.gsub(template,"=]%[=$(=]%[=w+ )",function(token) gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= @@[= end=]@@
@@[==]][==]=[==]][==]@@
Changed line(s) 425,432 (click to see context) from:
@@[= --get the ep title=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
to:
Changed line(s) 434 (click to see context) from:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
to:
Changed line(s) 438,444 (click to see context) from:
@@[= return tvtropes.post(=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
to:
Changed line(s) 448,465 (click to see context) from:
@@[= return function(s,e)=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
to:
Changed line(s) 469,474 (click to see context) from:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
to:
Is there an issue? Send a MessageReason:
None
Added DiffLines:
* DeadLikeMe (not including ''Life After Death'')
Is there an issue? Send a MessageReason:
None
Deleted line(s) 5,32 (click to see context) :
!TV shows I've seen every episode of:
(This doesn't necessarily reflect my opinion on a show. I just like to finish what I start, media-wise.)
* ArrestedDevelopment
* {{Blackadder}} (including ''Back and Forth'')
* TheCritic
* {{Dollhouse}}
* {{Firefly}}
* [[{{Freakazoid}} Freakazoid!]]
* {{Futurama}} (up through the four movies)
* GilligansIsland
* LifeOnMars (the British one, obviously)
* LookAroundYou
* PeepShow
* PoliceSquad
* PushingDaisies
* {{Spaced}}
* TheWire
!!Ones that I'm up to a certain point in:
* TheATeam (through season one)
* {{Reaper}} (through season one)
!!!Shows still in production:
* {{Community}} (one season)
* {{Archer}} (one season)
(This doesn't necessarily reflect my opinion on a show. I just like to finish what I start, media-wise.)
* ArrestedDevelopment
* {{Blackadder}} (including ''Back and Forth'')
* TheCritic
* {{Dollhouse}}
* {{Firefly}}
* [[{{Freakazoid}} Freakazoid!]]
* {{Futurama}} (up through the four movies)
* GilligansIsland
* LifeOnMars (the British one, obviously)
* LookAroundYou
* PeepShow
* PoliceSquad
* PushingDaisies
* {{Spaced}}
* TheWire
!!Ones that I'm up to a certain point in:
* TheATeam (through season one)
* {{Reaper}} (through season one)
!!!Shows still in production:
* {{Community}} (one season)
* {{Archer}} (one season)
Changed line(s) 509 (click to see context) from:
%%ENDSCRIPTS%%
to:
!TV shows I've seen every episode of:
(This doesn't necessarily reflect my opinion on a show. I just like to finish what I start, media-wise.)
* ArrestedDevelopment
* {{Blackadder}} (including ''Back and Forth'')
* TheCritic
* {{Dollhouse}}
* {{Firefly}}
* [[{{Freakazoid}} Freakazoid!]]
* {{Futurama}} (up through the four movies)
* GilligansIsland
* LifeOnMars (the British one, obviously)
* LookAroundYou
* PeepShow
* PoliceSquad
* PushingDaisies
* {{Spaced}}
* TheWire
!!Ones that I'm up to a certain point in:
* TheATeam (through season one)
* {{Reaper}} (through season one)
!!!Shows still in production:
* {{Community}} (one season)
* {{Archer}} (one season)
Is there an issue? Send a MessageReason:
None
Changed line(s) 1,2 (click to see context) from:
Northwestern 21-year old nerd kid in the games industry. Programs in UsefulNotes/Lua.
to:
Northwestern 21-year old nerd kid in the games industry. Programs in UsefulNotes/Lua.
{{Lua}}.
Is there an issue? Send a MessageReason:
None
Changed line(s) 1,2 (click to see context) from:
Northwestern 21-year old nerd kid in the games industry.
to:
Northwestern 21-year old nerd kid in the games industry.
industry. Programs in UsefulNotes/Lua.
Is there an issue? Send a MessageReason:
None
!Lua scripts:
Changed line(s) 38 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
to:
@@[=local urlencode=]=[={}=]@@
Changed line(s) 43 (click to see context) from:
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
to:
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
Changed line(s) 47,48 (click to see context) from:
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
to:
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[==]~[= =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
Changed line(s) 54 (click to see context) from:
@@[=urlencode.string =]=[= encode=]@@
to:
@@[=urlencode.string =]=[= encode=]@@
Changed line(s) 59 (click to see context) from:
@@[= local argts, i=]=[= {}, 1=]@@
to:
@@[= local argts, i=]=[= {}, 1=]@@
Changed line(s) 61,62 (click to see context) from:
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+1=]@@
@@[= i=]=[=i+1=]@@
to:
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+1=]@@
@@[= i=]=[=i+1=]@@
Changed line(s) 72 (click to see context) from:
@@[=local http =]=[= require"socket.http"=]@@
to:
@@[=local http =]=[= require"socket.http"=]@@
Changed line(s) 75 (click to see context) from:
@@[=local urlencode =]=[= require "urlencode"=]@@
to:
@@[=local urlencode =]=[= require "urlencode"=]@@
Changed line(s) 77 (click to see context) from:
@@[=local tvtropes=]=[={}=]@@
to:
@@[=local tvtropes=]=[={}=]@@
Changed line(s) 86 (click to see context) from:
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
to:
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
Changed line(s) 88 (click to see context) from:
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
to:
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
Changed line(s) 96 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@
Changed line(s) 98 (click to see context) from:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
to:
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
Changed line(s) 100 (click to see context) from:
@@[= local response =]=[==]@@
to:
@@[= local response =]=[==]@@
Changed line(s) 103,106 (click to see context) from:
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
to:
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
Changed line(s) 110 (click to see context) from:
@@[= assert(response[1=]][=,response[2=]][=)=]@@
to:
@@[= assert(response[1=]][=,response[2=]][=)=]@@
Changed line(s) 114,115 (click to see context) from:
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
to:
@@[= if tonumber(response[2=]][=)=]~[==]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
Changed line(s) 124 (click to see context) from:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
to:
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
Changed line(s) 127,128 (click to see context) from:
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
to:
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
Changed line(s) 136 (click to see context) from:
@@[= page=]=[=fullname(page)=]@@
to:
@@[= page=]=[=fullname(page)=]@@
Changed line(s) 138,139 (click to see context) from:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
to:
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
Changed line(s) 152 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
to:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
Changed line(s) 154,155 (click to see context) from:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
to:
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[=local user=]=[="STUART"=]@@
Changed line(s) 157 (click to see context) from:
@@[=local scripts=]=[={=]@@
to:
@@[=local scripts=]=[={=]@@
Changed line(s) 166 (click to see context) from:
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
to:
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
Changed line(s) 171,173 (click to see context) from:
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
to:
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
Changed line(s) 175 (click to see context) from:
@@[= local headers=]=[=#folders=]@@
to:
@@[= local headers=]=[=#folders=]@@
Changed line(s) 177,179 (click to see context) from:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
to:
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
Changed line(s) 181,182 (click to see context) from:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
to:
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
Changed line(s) 185,186 (click to see context) from:
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
to:
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]~[==]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
Changed line(s) 188 (click to see context) from:
@@[= slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
to:
@@[= slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
Changed line(s) 192,193 (click to see context) from:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
to:
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
Changed line(s) 196 (click to see context) from:
@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
to:
@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
Changed line(s) 202 (click to see context) from:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 204 (click to see context) from:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
to:
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
Changed line(s) 206 (click to see context) from:
@@[= local current=]=[=tvtropes.get(target)=]@@
to:
@@[= local current=]=[=tvtropes.get(target)=]@@
Changed line(s) 208,209 (click to see context) from:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
to:
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
Changed line(s) 212 (click to see context) from:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
to:
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
Changed line(s) 216 (click to see context) from:
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
to:
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
Changed line(s) 232 (click to see context) from:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
to:
@@[=local tvtropes=]=[=require "tvtropes"=]@@
Changed line(s) 234 (click to see context) from:
@@[=local urlencode=]=[=require "urlencode"=]@@
to:
@@[=local urlencode=]=[=require "urlencode"=]@@
Changed line(s) 237 (click to see context) from:
@@[=adeps=]=[={=]@@
to:
@@[=adeps=]=[={=]@@
Changed line(s) 301 (click to see context) from:
@@[=local tokens=]=[={}=]@@
to:
@@[=local tokens=]=[={}=]@@
Changed line(s) 306 (click to see context) from:
@@[= local disambigeps=]=[={=]@@
to:
@@[= local disambigeps=]=[={=]@@
Changed line(s) 313,317 (click to see context) from:
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
to:
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
Changed line(s) 323,326 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
to:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
Changed line(s) 331 (click to see context) from:
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
to:
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
Changed line(s) 340,342 (click to see context) from:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
to:
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
Changed line(s) 348 (click to see context) from:
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
to:
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
Changed line(s) 353,354 (click to see context) from:
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
to:
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
Changed line(s) 361 (click to see context) from:
@@[= local ttnums=]=[={=]@@
to:
@@[= local ttnums=]=[={=]@@
Changed line(s) 378 (click to see context) from:
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
to:
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
Changed line(s) 383 (click to see context) from:
@@[= local watchnums=]=[={=]@@
to:
@@[= local watchnums=]=[={=]@@
Changed line(s) 400 (click to see context) from:
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
to:
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
Changed line(s) 409 (click to see context) from:
@@[= local movieids=]=[={=]@@
to:
@@[= local movieids=]=[={=]@@
Changed line(s) 426 (click to see context) from:
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
to:
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
Changed line(s) 435,436 (click to see context) from:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
to:
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
Changed line(s) 438 (click to see context) from:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
to:
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
Changed line(s) 440 (click to see context) from:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
to:
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
Changed line(s) 442,443 (click to see context) from:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[==]][==]=[==]][==]@@
to:
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[==]][==]=[==]][==]@@
Changed line(s) 445 (click to see context) from:
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
to:
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
Changed line(s) 452 (click to see context) from:
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
to:
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
Changed line(s) 454 (click to see context) from:
@@[= title=]=[=string.gsub(title,'é','e')=]@@
to:
@@[= title=]=[=string.gsub(title,'é','e')=]@@
Changed line(s) 456 (click to see context) from:
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
to:
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
Changed line(s) 458 (click to see context) from:
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
to:
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
Changed line(s) 460 (click to see context) from:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
to:
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
Changed line(s) 467,468 (click to see context) from:
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
to:
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
Changed line(s) 476 (click to see context) from:
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
to:
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
Changed line(s) 479,481 (click to see context) from:
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
to:
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
Changed line(s) 485,486 (click to see context) from:
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
to:
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
Changed line(s) 495,497 (click to see context) from:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
to:
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
Is there an issue? Send a MessageReason:
OK, think I got it now
Changed line(s) 39 (click to see context) from:
@@@@\\
to:
Changed line(s) 52 (click to see context) from:
@@@@\\
to:
Changed line(s) 55 (click to see context) from:
@@@@\\
to:
Changed line(s) 66 (click to see context) from:
@@@@\\
to:
Changed line(s) 73 (click to see context) from:
@@@@\\
to:
Changed line(s) 76 (click to see context) from:
@@@@\\
to:
Changed line(s) 78 (click to see context) from:
@@@@\\
to:
Changed line(s) 83 (click to see context) from:
@@@@\\
to:
Changed line(s) 89 (click to see context) from:
@@@@\\
to:
Changed line(s) 92 (click to see context) from:
@@@@\\
to:
Changed line(s) 95 (click to see context) from:
@@@@\\
to:
Changed line(s) 97 (click to see context) from:
@@@@\\
to:
Changed line(s) 99 (click to see context) from:
@@@@\\
to:
Changed line(s) 108 (click to see context) from:
@@@@\\
to:
Changed line(s) 111 (click to see context) from:
@@@@\\
to:
Changed line(s) 119 (click to see context) from:
@@@@\\
to:
Changed line(s) 125 (click to see context) from:
@@@@\\
to:
Changed line(s) 132 (click to see context) from:
@@@@\\
to:
Changed line(s) 135 (click to see context) from:
@@@@\\
to:
Changed line(s) 137 (click to see context) from:
@@@@\\
to:
Changed line(s) 140 (click to see context) from:
@@@@\\
to:
Changed line(s) 143 (click to see context) from:
@@@@\\
to:
Changed line(s) 147 (click to see context) from:
@@@@\\
to:
Changed line(s) 153 (click to see context) from:
@@@@\\
to:
Changed line(s) 156 (click to see context) from:
@@@@\\
to:
Changed line(s) 163 (click to see context) from:
@@@@\\
to:
Changed line(s) 169 (click to see context) from:
@@@@\\
to:
Changed line(s) 176 (click to see context) from:
@@@@\\
to:
Changed line(s) 180 (click to see context) from:
@@@@\\
to:
Changed line(s) 182 (click to see context) from:
@@[= slines[#slines+1=]][==]=[='@@@@\\\\'=]@@
to:
@@[= slines[#slines+1=]][==]=[='@@@@\\\\'=]@@slines[#slines+1=]][==]=[='\\\\'=]@@
Changed line(s) 187 (click to see context) from:
@@@@\\
to:
Changed line(s) 191 (click to see context) from:
@@@@\\
to:
Changed line(s) 195 (click to see context) from:
@@@@\\
to:
Changed line(s) 197 (click to see context) from:
@@@@\\
to:
Changed line(s) 200 (click to see context) from:
@@@@\\
to:
Changed line(s) 203 (click to see context) from:
@@@@\\
to:
Changed line(s) 205 (click to see context) from:
@@@@\\
to:
Changed line(s) 207 (click to see context) from:
@@@@\\
to:
Changed line(s) 211 (click to see context) from:
@@@@\\
to:
Changed line(s) 213 (click to see context) from:
@@@@\\
to:
Changed line(s) 220 (click to see context) from:
@@@@\\
to:
Changed line(s) 222,225 (click to see context) from:
@@@@\\
@@[=push "oh god I'm never going to get it right"=]@@
@@@@\\
@@@@\\
@@[=push "oh god I'm never going to get it right"=]@@
@@@@\\
@@@@\\
to:
@@[=push
@@@@\\
@@@@\\
\\
\\
Changed line(s) 230 (click to see context) from:
@@@@\\
to:
Changed line(s) 235 (click to see context) from:
@@@@\\
to:
Changed line(s) 299 (click to see context) from:
@@@@\\
to:
Changed line(s) 302 (click to see context) from:
@@@@\\
to:
Changed line(s) 311 (click to see context) from:
@@@@\\
to:
Changed line(s) 320 (click to see context) from:
@@@@\\
to:
Changed line(s) 333 (click to see context) from:
@@@@\\
to:
Changed line(s) 337 (click to see context) from:
@@@@\\
to:
Changed line(s) 345 (click to see context) from:
@@@@\\
to:
Changed line(s) 349 (click to see context) from:
@@@@\\
to:
Changed line(s) 357 (click to see context) from:
@@@@\\
to:
Changed line(s) 375 (click to see context) from:
@@@@\\
to:
Changed line(s) 381 (click to see context) from:
@@@@\\
to:
Changed line(s) 397 (click to see context) from:
@@@@\\
to:
Changed line(s) 403 (click to see context) from:
@@@@\\
to:
Changed line(s) 423 (click to see context) from:
@@@@\\
to:
Changed line(s) 429 (click to see context) from:
@@@@\\
to:
Changed line(s) 431 (click to see context) from:
@@@@\\
to:
Changed line(s) 439 (click to see context) from:
@@@@\\
to:
Changed line(s) 448 (click to see context) from:
@@@@\\
to:
Changed line(s) 459 (click to see context) from:
@@@@\\
to:
Changed line(s) 462 (click to see context) from:
@@@@\\
to:
Changed line(s) 472 (click to see context) from:
@@@@\\
to:
Changed line(s) 493 (click to see context) from:
@@@@\\
to:
Changed line(s) 503 (click to see context) from:
@@@@\\
to:
Is there an issue? Send a MessageReason:
oh god I'm never going to get it right
Changed line(s) 38,67 (click to see context) from:
->@@[=local urlencode=]=[={}=]@@
->@@@@\\
->@@[=--URL encode a string.=]@@
->@@[=local function encode(str)=]@@
->@@[= --Ensure all newlines are in CRLF form=]@@
->@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
->@@[= --Percent-encode all non-unreserved characters=]@@
->@@[= --as per RFC 3986, Section 2.3=]@@
->@@[= --(except for space, which gets plus-encoded)=]@@
->@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[=~ =]][=)",=]@@
->@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
->@@[= --Convert spaces to plus signs=]@@
->@@[= return string.gsub (str, " ", "+")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Make this function available as part of the module=]@@
->@@[=urlencode.string =]=[= encode=]@@
->@@@@\\
->@@[=--URL encode a table as a series of parameters.=]@@
->@@[=function urlencode.table(t)=]@@
->@@[= --table of argument strings=]@@
->@@[= local argts, i=]=[= {}, 1=]@@
->@@[= for k, v in pairs(t) do=]@@
->@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
->@@[= i=]=[=i+1=]@@
->@@[= end=]@@
->@@[= return table.concat(argts,'&')=]@@
->@@[=end=]@@
->@@@@\\
->@@[=return urlencode=]@@
->@@@@\\
->@@[=--URL encode a string.=]@@
->@@[=local function encode(str)=]@@
->@@[= --Ensure all newlines are in CRLF form=]@@
->@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
->@@[= --Percent-encode all non-unreserved characters=]@@
->@@[= --as per RFC 3986, Section 2.3=]@@
->@@[= --(except for space, which gets plus-encoded)=]@@
->@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[=~ =]][=)",=]@@
->@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
->@@[= --Convert spaces to plus signs=]@@
->@@[= return string.gsub (str, " ", "+")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Make this function available as part of the module=]@@
->@@[=urlencode.string =]=[= encode=]@@
->@@@@\\
->@@[=--URL encode a table as a series of parameters.=]@@
->@@[=function urlencode.table(t)=]@@
->@@[= --table of argument strings=]@@
->@@[= local argts, i=]=[= {}, 1=]@@
->@@[= for k, v in pairs(t) do=]@@
->@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
->@@[= i=]=[=i+1=]@@
->@@[= end=]@@
->@@[= return table.concat(argts,'&')=]@@
->@@[=end=]@@
->@@@@\\
->@@[=return urlencode=]@@
to:
->@@[=--URL
@@[=--URL encode a string.=]@@
->@@@@\\
->@@[=--Make
@@@@\\
@@[=--Make this function available as part of the module=]@@
->@@[=--URL
@@[=--URL encode a table as a series of parameters.=]@@
->@@@@\\
->@@[=return
@@@@\\
@@[=return urlencode=]@@
Changed line(s) 71,148 (click to see context) from:
->@@[=--Required to send to TVTropes site.=]@@
->@@[=local http =]=[= require"socket.http"=]@@
->@@@@\\
->@@[=--Required to create page post data.=]@@
->@@[=local urlencode =]=[= require "urlencode"=]@@
->@@@@\\
->@@[=local tvtropes=]=[={}=]@@
->@@@@\\
->@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
->@@[=local function authpageurl(page)=]@@
->@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function fullname(page)=]@@
->@@[= --Require pagename=]@@
->@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
->@@[= --If no namespace specified, assume Main=]@@
->@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
->@@@@\\
->@@[= return page=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that posts the given page.=]@@
->@@[=function tvtropes.post(page, body, author, reason)=]@@
->@@@@\\
->@@[= page=]=[=fullname(page)=]@@
->@@@@\\
->@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
->@@@@\\
->@@[= local response =]=[==]@@
->@@[= {http.request(authpageurl(page),=]@@
->@@[= urlencode.table{=]@@
->@@[= action=]=[="post", post=]=[="save",=]@@
->@@[= pagename=]=[=page, text=]=[=body,=]@@
->@@[= author=]=[=author or "Anonymous",=]@@
->@@[= reason=]=[=reason or ""=]@@
->@@[= })}=]@@
->@@@@\\
->@@[= --Error on any socket errors=]@@
->@@[= assert(response[1=]][=,response[2=]][=)=]@@
->@@@@\\
->@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
->@@[= --sometimes it just rejects the password for some reason.=]@@
->@@[= if tonumber(response[2=]][=)~=]=[=302 then=]@@
->@@[= return nil, response[2=]][=, response[1=]][==]@@
->@@[= else return true=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
->@@[=--TVTropes' source converter, so it's kept in here.=]@@
->@@[=local html2plain=]@@
->@@[=do=]@@
->@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
->@@@@\\
->@@[= function html2plain(src)=]@@
->@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
->@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
->@@[= return src=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that gets a given page source.=]@@
->@@[=function tvtropes.get(page)=]@@
->@@@@\\
->@@[= page=]=[=fullname(page)=]@@
->@@@@\\
->@@[= local body, code =]=[= http.request(=]@@
->@@[= authpageurl(page)..'?action=]=[=source')=]@@
->@@@@\\
->@@[= --Trigger error on socket failure=]@@
->@@[= assert(body,code)=]@@
->@@@@\\
->@@[= --Return the source converted back from the HTML conversion=]@@
->@@[= return html2plain(body)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=return tvtropes=]@@
->@@[=local http =]=[= require"socket.http"=]@@
->@@@@\\
->@@[=--Required to create page post data.=]@@
->@@[=local urlencode =]=[= require "urlencode"=]@@
->@@@@\\
->@@[=local tvtropes=]=[={}=]@@
->@@@@\\
->@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
->@@[=local function authpageurl(page)=]@@
->@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function fullname(page)=]@@
->@@[= --Require pagename=]@@
->@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
->@@[= --If no namespace specified, assume Main=]@@
->@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
->@@@@\\
->@@[= return page=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that posts the given page.=]@@
->@@[=function tvtropes.post(page, body, author, reason)=]@@
->@@@@\\
->@@[= page=]=[=fullname(page)=]@@
->@@@@\\
->@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
->@@@@\\
->@@[= local response =]=[==]@@
->@@[= {http.request(authpageurl(page),=]@@
->@@[= urlencode.table{=]@@
->@@[= action=]=[="post", post=]=[="save",=]@@
->@@[= pagename=]=[=page, text=]=[=body,=]@@
->@@[= author=]=[=author or "Anonymous",=]@@
->@@[= reason=]=[=reason or ""=]@@
->@@[= })}=]@@
->@@@@\\
->@@[= --Error on any socket errors=]@@
->@@[= assert(response[1=]][=,response[2=]][=)=]@@
->@@@@\\
->@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
->@@[= --sometimes it just rejects the password for some reason.=]@@
->@@[= if tonumber(response[2=]][=)~=]=[=302 then=]@@
->@@[= return nil, response[2=]][=, response[1=]][==]@@
->@@[= else return true=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
->@@[=--TVTropes' source converter, so it's kept in here.=]@@
->@@[=local html2plain=]@@
->@@[=do=]@@
->@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
->@@@@\\
->@@[= function html2plain(src)=]@@
->@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
->@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
->@@[= return src=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that gets a given page source.=]@@
->@@[=function tvtropes.get(page)=]@@
->@@@@\\
->@@[= page=]=[=fullname(page)=]@@
->@@@@\\
->@@[= local body, code =]=[= http.request(=]@@
->@@[= authpageurl(page)..'?action=]=[=source')=]@@
->@@@@\\
->@@[= --Trigger error on socket failure=]@@
->@@[= assert(body,code)=]@@
->@@@@\\
->@@[= --Return the source converted back from the HTML conversion=]@@
->@@[= return html2plain(body)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=return tvtropes=]@@
to:
->@@[=--Required
@@[=--Required to create page post data.=]@@
->@@[=local
@@[=local tvtropes=]=[={}=]@@
->@@[=--Function
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function fullname(page)=]@@
->@@[=
@@[= return page=]@@
->@@@@\\
->@@[=--Function
@@@@\\
@@[=--Function that posts the given page.=]@@
->@@[=
@@[= page=]=[=fullname(page)=]@@
->@@[=
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
->@@[=
@@[= local response =]=[==]@@
->@@[=
@@[= --Error on any socket errors=]@@
->@@[=
@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
->@@@@\\
->@@[=--Technically,
@@@@\\
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
->@@[=
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
->@@[=
@@[= function html2plain(src)=]@@
->@@@@\\
->@@[=--Function
@@@@\\
@@[=--Function that gets a given page source.=]@@
->@@[=
@@[= page=]=[=fullname(page)=]@@
->@@[=
@@[= local body, code =]=[= http.request(=]@@
->@@[=
@@[= --Trigger error on socket failure=]@@
->@@[=
@@[= --Return the source converted back from the HTML conversion=]@@
->@@@@\\
->@@[=return
@@@@\\
@@[=return tvtropes=]@@
Changed line(s) 152,225 (click to see context) from:
->@@[=local tvtropes =]=[= require "tvtropes"=]@@
->@@@@\\
->@@[=local target =]=[= "Tropers/STUART"=]@@
->@@[=local user=]=[="STUART"=]@@
->@@@@\\
->@@[=local scripts=]=[={=]@@
->@@[= "urlencode.lua",=]@@
->@@[= "tvtropes.lua",=]@@
->@@[= "tropersrepo.lua",=]@@
->@@[= "arrdev_recap.lua",=]@@
->@@[=}=]@@
->@@@@\\
->@@[=local function scriptfolder(name,script)=]@@
->@@[= return string.format(=]@@
->@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
->@@[= name,script)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function revsection()=]@@
->@@[= local folders=]=[={=]@@
->@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
->@@[= "[[foldercontrol=]][==]][="=]@@
->@@[= }=]@@
->@@[= local headers=]=[=#folders=]@@
->@@@@\\
->@@[= for i=]=[=1, #scripts do=]@@
->@@[= local slines=]=[={}=]@@
->@@[= for line in io.lines(scripts[i=]][=) do=]@@
->@@@@\\
->@@[= --escape all equals signs and percents=]@@
->@@[= if line=]=[==]=[="" then=]@@
->@@[= slines[#slines+1=]][==]=[='->@@@@\\\\'=]@@
->@@[= else=]@@
->@@[= local escaped=]=[=string.gsub(line,"[=]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
->@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
->@@@@\\
->@@[= slines[#slines+1=]][==]=[=string.format("->@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@@@\\
->@@[= local content=]=[=table.concat(slines,'\n')=]@@
->@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
->@@[= end=]@@
->@@@@\\
->@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
->@@@@\\
->@@[= return table.concat(folders,"\n\n")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function push(notes)=]@@
->@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
->@@@@\\
->@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
->@@@@\\
->@@[= local current=]=[=tvtropes.get(target)=]@@
->@@@@\\
->@@[= local updated=]=[=string.gsub(current,=]@@
->@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
->@@[= gssscripts)=]@@
->@@@@\\
->@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
->@@@@\\
->@@[= local posted=]@@
->@@[= while not posted do=]@@
->@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
->@@[= if not posted then print" Retrying..." end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Executing code---------------------------------------------------------------=]@@
->@@@@\\
->@@[=push "oh god I'm never going to get it right"=]@@
->@@@@\\
->@@@@\\
->@@@@\\
->@@[=local target =]=[= "Tropers/STUART"=]@@
->@@[=local user=]=[="STUART"=]@@
->@@@@\\
->@@[=local scripts=]=[={=]@@
->@@[= "urlencode.lua",=]@@
->@@[= "tvtropes.lua",=]@@
->@@[= "tropersrepo.lua",=]@@
->@@[= "arrdev_recap.lua",=]@@
->@@[=}=]@@
->@@@@\\
->@@[=local function scriptfolder(name,script)=]@@
->@@[= return string.format(=]@@
->@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
->@@[= name,script)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function revsection()=]@@
->@@[= local folders=]=[={=]@@
->@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
->@@[= "[[foldercontrol=]][==]][="=]@@
->@@[= }=]@@
->@@[= local headers=]=[=#folders=]@@
->@@@@\\
->@@[= for i=]=[=1, #scripts do=]@@
->@@[= local slines=]=[={}=]@@
->@@[= for line in io.lines(scripts[i=]][=) do=]@@
->@@@@\\
->@@[= --escape all equals signs and percents=]@@
->@@[= if line=]=[==]=[="" then=]@@
->@@[= slines[#slines+1=]][==]=[='->@@@@\\\\'=]@@
->@@[= else=]@@
->@@[= local escaped=]=[=string.gsub(line,"[=]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
->@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
->@@@@\\
->@@[= slines[#slines+1=]][==]=[=string.format("->@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@@@\\
->@@[= local content=]=[=table.concat(slines,'\n')=]@@
->@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
->@@[= end=]@@
->@@@@\\
->@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
->@@@@\\
->@@[= return table.concat(folders,"\n\n")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function push(notes)=]@@
->@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
->@@@@\\
->@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
->@@@@\\
->@@[= local current=]=[=tvtropes.get(target)=]@@
->@@@@\\
->@@[= local updated=]=[=string.gsub(current,=]@@
->@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
->@@[= gssscripts)=]@@
->@@@@\\
->@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
->@@@@\\
->@@[= local posted=]@@
->@@[= while not posted do=]@@
->@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
->@@[= if not posted then print" Retrying..." end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Executing code---------------------------------------------------------------=]@@
->@@@@\\
->@@[=push "oh god I'm never going to get it right"=]@@
->@@@@\\
->@@@@\\
to:
->@@[=local
@@[=local target =]=[= "Tropers/STUART"=]@@
->@@[=local
@@[=local scripts=]=[={=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function scriptfolder(name,script)=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function revsection()=]@@
->@@[=
@@[= for i=]=[=1, #scripts do=]@@
->@@[=
@@[= if line=]=[==]=[="" then=]@@
@@[= slines[#slines+1=]][==]=[='@@@@\\\\'=]@@
@@[= else=]@@
@@[= --escape all equals signs and percents=]@@
->@@[= slines[#slines+1=]][==]=[='->@@@@\\\\'=]@@
->@@[= else=]@@
->@@[=
->@@[=
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
->@@[=
@@[= slines[#slines+1=]][==]=[=string.
->@@[=
@@[= end=]@@
->@@[=
@@[= local content=]=[=table.concat(slines,'\n')=]@@
->@@[=
@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
->@@[=
@@[= return table.concat(folders,"\n\n")=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function push(notes)=]@@
->@@[=
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
->@@[=
@@[= local current=]=[=tvtropes.get(target)=]@@
->@@[=
@@[= local updated=]=[=string.gsub(current,=]@@
->@@[=
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
->@@[=
@@[= local posted=]@@
->@@@@\\
->@@[=--Executing
@@@@\\
@@[=--Executing code---------------------------------------------------------------=]@@
->@@[=push
@@[=push "oh god I'm never going to get it right"=]@@
->@@@@\\
@@@@\\
Changed line(s) 229,504 (click to see context) from:
->@@[=--encoding: UTF-8=]@@
->@@@@\\
->@@[=--Required to post pages=]@@
->@@[=local tvtropes=]=[=require "tvtropes"=]@@
->@@[=--Required for encoding Wikipedia article titles=]@@
->@@[=local urlencode=]=[=require "urlencode"=]@@
->@@@@\\
->@@[=--Arrested Development data----------------------------------------------------=]@@
->@@[=adeps=]=[={=]@@
->@@[= {=]@@
->@@[= "Pilot",=]@@
->@@[= "Top Banana",=]@@
->@@[= "Bringing Up Buster",=]@@
->@@[= "Key Decisions",=]@@
->@@[= "Visiting Ours",=]@@
->@@[= "Charity Drive",=]@@
->@@[= "My Mother, The Car",=]@@
->@@[= "In God We Trust",=]@@
->@@[= "Storming the Castle",=]@@
->@@[= "Pier Pressure",=]@@
->@@[= "Public Relations",=]@@
->@@[= "Marta Complex",=]@@
->@@[= "Beef Consommé",=]@@
->@@[= "Shock and Aww",=]@@
->@@[= "Staff Infection",=]@@
->@@[= "Missing Kitty",=]@@
->@@[= "Altar Egos",=]@@
->@@[= "Justice Is Blind",=]@@
->@@[= "Best Man for the GOB",=]@@
->@@[= "Whistler's Mother",=]@@
->@@[= "Not Without My Daughter",=]@@
->@@[= "Let 'Em Eat Cake"=]@@
->@@[= },=]@@
->@@[= {=]@@
->@@[= "The One Where Michael Leaves",=]@@
->@@[= "The One Where They Build a House",=]@@
->@@[= "¡Amigos!",=]@@
->@@[= "Good Grief",=]@@
->@@[= "Sad Sack",=]@@
->@@[= "Afternoon Delight",=]@@
->@@[= "Switch Hitter",=]@@
->@@[= "Queen for a Day",=]@@
->@@[= "Burning Love",=]@@
->@@[= "Ready, Aim, Marry Me",=]@@
->@@[= "Out on a Limb",=]@@
->@@[= "Hand to God",=]@@
->@@[= "Motherboy XXX",=]@@
->@@[= "The Immaculate Election",=]@@
->@@[= "Sword of Destiny",=]@@
->@@[= "Meat the Veals",=]@@
->@@[= "Spring Breakout",=]@@
->@@[= "Righteous Brothers",=]@@
->@@[= },=]@@
->@@[= {=]@@
->@@[= "The Cabin Show",=]@@
->@@[= "For British Eyes Only",=]@@
->@@[= "Forget-Me-Now",=]@@
->@@[= "Notapusy",=]@@
->@@[= "Mr. F",=]@@
->@@[= "The Ocean Walker",=]@@
->@@[= "Prison Break-In",=]@@
->@@[= "Making a Stand",=]@@
->@@[= "S.O.B.s",=]@@
->@@[= "Fakin' It",=]@@
->@@[= "Family Ties",=]@@
->@@[= "Exit Strategy",=]@@
->@@[= "Development Arrested"=]@@
->@@[= },=]@@
->@@[=}=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Interwiki data---------------------------------------------------------------=]@@
->@@[=local tokens=]=[={}=]@@
->@@@@\\
->@@[=do --wikipedia=]@@
->@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
->@@[= --whose article titles end with "(Arrested Development)"=]@@
->@@[= local disambigeps=]=[={=]@@
->@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
->@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
->@@[= {10,11,12} --Season 3=]@@
->@@[= }=]@@
->@@@@\\
->@@[= --construct lookup table=]@@
->@@[= local disambiguated=]=[={}=]@@
->@@[= for s=]=[=1,#disambigeps do=]@@
->@@[= disambiguated[s=]][==]=[={}=]@@
->@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
->@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@@@\\
->@@[= --Function that returns the Wikipedia URL=]@@
->@@[= function tokens.wikipedia(s,e)=]@@
->@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
->@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
->@@[= pagename=]=[=urlencode.string(pagename)=]@@
->@@[= if disambiguated[s=]][=[e=]][= then=]@@
->@@[= --Technically, parentheses don't have to be percent-encoded=]@@
->@@[= --for HTTP URIs because they're unused sub-delims=]@@
->@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
->@@[= --the function that percent-encodes all sub-delims=]@@
->@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
->@@[= end=]@@
->@@@@\\
->@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
->@@[=function tokens.wikia(s,e)=]@@
->@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
->@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
->@@[= pagename=]=[=urlencode.string(pagename)=]@@
->@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Balboa Observer-Picayune=]@@
->@@[= --Season 1 episodes that are listed at different numbers=]@@
->@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
->@@@@\\
->@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
->@@[= function tokens.theop(s,e)=]@@
->@@[= --correct OutOfOrder Season 1 episodes=]@@
->@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
->@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --IMDB=]@@
->@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
->@@[= --that I have to use you=]@@
->@@[= local ttnums=]=[={=]@@
->@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
->@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
->@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
->@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
->@@[= 0515232, 0515224, },=]@@
->@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
->@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
->@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
->@@[= 0515227, 0515245, 0515241, },=]@@
->@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
->@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
->@@[= 0515217, 0515215, 0757386, }=]@@
->@@[= }=]@@
->@@@@\\
->@@[= --Function that returns the URL for the episode's IMDB page=]@@
->@@[= function tokens.imdb(s,e)=]@@
->@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Hulu, you know, just in case=]@@
->@@[= local watchnums=]=[={=]@@
->@@[= { 589, 1786, 585, 1781, 1785,=]@@
->@@[= 580, 590, 588, 586, 575,=]@@
->@@[= 576, 579, 577, 644, 1783,=]@@
->@@[= 591, 582, 584, 578, 581,=]@@
->@@[= 583, 587},=]@@
->@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
->@@[= 12883, 13226, 12561, 12609, 12298,=]@@
->@@[= 12271, 12901, 13248, 13267, 13276,=]@@
->@@[= 13206, 12232, 12532},=]@@
->@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
->@@[= 12497, 17189, 12523, 13139, 12225,=]@@
->@@[= 12317, 12194, 12215},=]@@
->@@[= }=]@@
->@@@@\\
->@@[= function tokens.hulu(s,e)=]@@
->@@[= return string.format(=]@@
->@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Netflix Watch Instantly=]@@
->@@[= --It's largely sequential, but not quite.=]@@
->@@[= --I printed out all the numbers and moved them around=]@@
->@@[= --to fit the correct order (which is both inconsistent=]@@
->@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
->@@[= local movieids=]=[={=]@@
->@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
->@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
->@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
->@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
->@@[= 70133693, 70133694, },=]@@
->@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
->@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
->@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
->@@[= 70133709, 70133710, 70133712, },=]@@
->@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
->@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
->@@[= 70133723, 70133724, 70133725, }=]@@
->@@[= }=]@@
->@@@@\\
->@@[= function tokens.netflix(s,e)=]@@
->@@[= return string.format(=]@@
->@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
->@@[=local ad_ep_links=]@@
->@@[=do=]@@
->@@[= local template=]=[=[=]=[=[=]@@
->@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
->@@[=----=]@@
->@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
->@@@@\\
->@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
->@@[=----=]@@
->@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
->@@[==]][==]=[==]][==]@@
->@@[= function ad_ep_links(s,e)=]@@
->@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
->@@[=local function recap_pagename(s,e)=]@@
->@@[= --get the ep title=]@@
->@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
->@@[= --replace the é in Beef Consommé=]@@
->@@[= title=]=[=string.gsub(title,'é','e')=]@@
->@@[= --transform to CamelCased WikiWord=]@@
->@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
->@@[= --Remove all non-alphanumeric characters=]@@
->@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
->@@@@\\
->@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function post_ad_recap_starter(s,e)=]@@
->@@[= return tvtropes.post(=]@@
->@@[= recap_pagename(s,e),=]@@
->@@[= string.format(=]@@
->@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
->@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
->@@[= "STUART",=]@@
->@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function update_links(reason)=]@@
->@@[= return function(s,e)=]@@
->@@[= --until comment syntax is changed, Amigos is manual-only=]@@
->@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
->@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
->@@[= else=]@@
->@@[= local pagename=]=[=recap_pagename(s,e)=]@@
->@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
->@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
->@@[= local success=]@@
->@@[= while not success do=]@@
->@@[= local code=]@@
->@@[= success, code =]=[= tvtropes.post(pagename,=]@@
->@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
->@@[= "STUART",reason)=]@@
->@@[= if not success then print("Retrying... "..code) end=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function for_all_eps(f)=]@@
->@@[= for s=]=[=1,#adeps do=]@@
->@@[= for e=]=[=1,#adeps[s=]][= do=]@@
->@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
->@@[= f(s,e)=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Okay, put your executing commands down here.=]@@
->@@@@\\
->@@[=--Required to post pages=]@@
->@@[=local tvtropes=]=[=require "tvtropes"=]@@
->@@[=--Required for encoding Wikipedia article titles=]@@
->@@[=local urlencode=]=[=require "urlencode"=]@@
->@@@@\\
->@@[=--Arrested Development data----------------------------------------------------=]@@
->@@[=adeps=]=[={=]@@
->@@[= {=]@@
->@@[= "Pilot",=]@@
->@@[= "Top Banana",=]@@
->@@[= "Bringing Up Buster",=]@@
->@@[= "Key Decisions",=]@@
->@@[= "Visiting Ours",=]@@
->@@[= "Charity Drive",=]@@
->@@[= "My Mother, The Car",=]@@
->@@[= "In God We Trust",=]@@
->@@[= "Storming the Castle",=]@@
->@@[= "Pier Pressure",=]@@
->@@[= "Public Relations",=]@@
->@@[= "Marta Complex",=]@@
->@@[= "Beef Consommé",=]@@
->@@[= "Shock and Aww",=]@@
->@@[= "Staff Infection",=]@@
->@@[= "Missing Kitty",=]@@
->@@[= "Altar Egos",=]@@
->@@[= "Justice Is Blind",=]@@
->@@[= "Best Man for the GOB",=]@@
->@@[= "Whistler's Mother",=]@@
->@@[= "Not Without My Daughter",=]@@
->@@[= "Let 'Em Eat Cake"=]@@
->@@[= },=]@@
->@@[= {=]@@
->@@[= "The One Where Michael Leaves",=]@@
->@@[= "The One Where They Build a House",=]@@
->@@[= "¡Amigos!",=]@@
->@@[= "Good Grief",=]@@
->@@[= "Sad Sack",=]@@
->@@[= "Afternoon Delight",=]@@
->@@[= "Switch Hitter",=]@@
->@@[= "Queen for a Day",=]@@
->@@[= "Burning Love",=]@@
->@@[= "Ready, Aim, Marry Me",=]@@
->@@[= "Out on a Limb",=]@@
->@@[= "Hand to God",=]@@
->@@[= "Motherboy XXX",=]@@
->@@[= "The Immaculate Election",=]@@
->@@[= "Sword of Destiny",=]@@
->@@[= "Meat the Veals",=]@@
->@@[= "Spring Breakout",=]@@
->@@[= "Righteous Brothers",=]@@
->@@[= },=]@@
->@@[= {=]@@
->@@[= "The Cabin Show",=]@@
->@@[= "For British Eyes Only",=]@@
->@@[= "Forget-Me-Now",=]@@
->@@[= "Notapusy",=]@@
->@@[= "Mr. F",=]@@
->@@[= "The Ocean Walker",=]@@
->@@[= "Prison Break-In",=]@@
->@@[= "Making a Stand",=]@@
->@@[= "S.O.B.s",=]@@
->@@[= "Fakin' It",=]@@
->@@[= "Family Ties",=]@@
->@@[= "Exit Strategy",=]@@
->@@[= "Development Arrested"=]@@
->@@[= },=]@@
->@@[=}=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Interwiki data---------------------------------------------------------------=]@@
->@@[=local tokens=]=[={}=]@@
->@@@@\\
->@@[=do --wikipedia=]@@
->@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
->@@[= --whose article titles end with "(Arrested Development)"=]@@
->@@[= local disambigeps=]=[={=]@@
->@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
->@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
->@@[= {10,11,12} --Season 3=]@@
->@@[= }=]@@
->@@@@\\
->@@[= --construct lookup table=]@@
->@@[= local disambiguated=]=[={}=]@@
->@@[= for s=]=[=1,#disambigeps do=]@@
->@@[= disambiguated[s=]][==]=[={}=]@@
->@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
->@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@@@\\
->@@[= --Function that returns the Wikipedia URL=]@@
->@@[= function tokens.wikipedia(s,e)=]@@
->@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
->@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
->@@[= pagename=]=[=urlencode.string(pagename)=]@@
->@@[= if disambiguated[s=]][=[e=]][= then=]@@
->@@[= --Technically, parentheses don't have to be percent-encoded=]@@
->@@[= --for HTTP URIs because they're unused sub-delims=]@@
->@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
->@@[= --the function that percent-encodes all sub-delims=]@@
->@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
->@@[= end=]@@
->@@@@\\
->@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
->@@[=function tokens.wikia(s,e)=]@@
->@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
->@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
->@@[= pagename=]=[=urlencode.string(pagename)=]@@
->@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Balboa Observer-Picayune=]@@
->@@[= --Season 1 episodes that are listed at different numbers=]@@
->@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
->@@@@\\
->@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
->@@[= function tokens.theop(s,e)=]@@
->@@[= --correct OutOfOrder Season 1 episodes=]@@
->@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
->@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --IMDB=]@@
->@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
->@@[= --that I have to use you=]@@
->@@[= local ttnums=]=[={=]@@
->@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
->@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
->@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
->@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
->@@[= 0515232, 0515224, },=]@@
->@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
->@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
->@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
->@@[= 0515227, 0515245, 0515241, },=]@@
->@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
->@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
->@@[= 0515217, 0515215, 0757386, }=]@@
->@@[= }=]@@
->@@@@\\
->@@[= --Function that returns the URL for the episode's IMDB page=]@@
->@@[= function tokens.imdb(s,e)=]@@
->@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Hulu, you know, just in case=]@@
->@@[= local watchnums=]=[={=]@@
->@@[= { 589, 1786, 585, 1781, 1785,=]@@
->@@[= 580, 590, 588, 586, 575,=]@@
->@@[= 576, 579, 577, 644, 1783,=]@@
->@@[= 591, 582, 584, 578, 581,=]@@
->@@[= 583, 587},=]@@
->@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
->@@[= 12883, 13226, 12561, 12609, 12298,=]@@
->@@[= 12271, 12901, 13248, 13267, 13276,=]@@
->@@[= 13206, 12232, 12532},=]@@
->@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
->@@[= 12497, 17189, 12523, 13139, 12225,=]@@
->@@[= 12317, 12194, 12215},=]@@
->@@[= }=]@@
->@@@@\\
->@@[= function tokens.hulu(s,e)=]@@
->@@[= return string.format(=]@@
->@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=do --Netflix Watch Instantly=]@@
->@@[= --It's largely sequential, but not quite.=]@@
->@@[= --I printed out all the numbers and moved them around=]@@
->@@[= --to fit the correct order (which is both inconsistent=]@@
->@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
->@@[= local movieids=]=[={=]@@
->@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
->@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
->@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
->@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
->@@[= 70133693, 70133694, },=]@@
->@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
->@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
->@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
->@@[= 70133709, 70133710, 70133712, },=]@@
->@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
->@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
->@@[= 70133723, 70133724, 70133725, }=]@@
->@@[= }=]@@
->@@@@\\
->@@[= function tokens.netflix(s,e)=]@@
->@@[= return string.format(=]@@
->@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
->@@[=local ad_ep_links=]@@
->@@[=do=]@@
->@@[= local template=]=[=[=]=[=[=]@@
->@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
->@@[=----=]@@
->@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
->@@@@\\
->@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
->@@[=----=]@@
->@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
->@@[==]][==]=[==]][==]@@
->@@[= function ad_ep_links(s,e)=]@@
->@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
->@@[=local function recap_pagename(s,e)=]@@
->@@[= --get the ep title=]@@
->@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
->@@[= --replace the é in Beef Consommé=]@@
->@@[= title=]=[=string.gsub(title,'é','e')=]@@
->@@[= --transform to CamelCased WikiWord=]@@
->@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
->@@[= --Remove all non-alphanumeric characters=]@@
->@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
->@@@@\\
->@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function post_ad_recap_starter(s,e)=]@@
->@@[= return tvtropes.post(=]@@
->@@[= recap_pagename(s,e),=]@@
->@@[= string.format(=]@@
->@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
->@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
->@@[= "STUART",=]@@
->@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function update_links(reason)=]@@
->@@[= return function(s,e)=]@@
->@@[= --until comment syntax is changed, Amigos is manual-only=]@@
->@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
->@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
->@@[= else=]@@
->@@[= local pagename=]=[=recap_pagename(s,e)=]@@
->@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
->@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
->@@[= local success=]@@
->@@[= while not success do=]@@
->@@[= local code=]@@
->@@[= success, code =]=[= tvtropes.post(pagename,=]@@
->@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
->@@[= "STUART",reason)=]@@
->@@[= if not success then print("Retrying... "..code) end=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@@@\\
->@@[=local function for_all_eps(f)=]@@
->@@[= for s=]=[=1,#adeps do=]@@
->@@[= for e=]=[=1,#adeps[s=]][= do=]@@
->@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
->@@[= f(s,e)=]@@
->@@[= end=]@@
->@@[= end=]@@
->@@[=end=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Okay, put your executing commands down here.=]@@
to:
->@@[=--Required
@@[=--Required to post pages=]@@
->@@[=--Arrested
@@[=--Arrested Development data----------------------------------------------------=]@@
->@@[=
@@[= {=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Interwiki
@@[=-------------------------------------------------------------------------------=]@@
@@@@\\
@@[=--Interwiki data---------------------------------------------------------------=]@@
->@@[=do
@@[=do --wikipedia=]@@
->@@[=
@@[= --construct lookup table=]@@
->@@[=
@@[= --Function that returns the Wikipedia URL=]@@
->@@[=
@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
->@@@@\\
->@@[=--Function
@@@@\\
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
->@@@@\\
->@@[=do
@@@@\\
@@[=do --Balboa Observer-Picayune=]@@
->@@[=
@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
->@@@@\\
->@@[=do
@@@@\\
@@[=do --IMDB=]@@
->@@[=
@@[= --Function that returns the URL for the episode's IMDB page=]@@
->@@@@\\
->@@[=do
@@@@\\
@@[=do --Hulu, you know, just in case=]@@
->@@[=
@@[= function tokens.hulu(s,e)=]@@
->@@@@\\
->@@[=do
@@@@\\
@@[=do --Netflix Watch Instantly=]@@
->@@[=
@@[= function tokens.netflix(s,e)=]@@
->@@@@\\
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Arrested
@@@@\\
@@[=-------------------------------------------------------------------------------=]@@
@@@@\\
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
->@@[=
@@[= local template=]=[=[=]=[=[=]@@
->@@[=----=]@@
->@@[=Interwiki:
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
->@@[=Watch
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
->@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
->@@[==]][==]=[==]][==]@@
->@@[=
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
->@@@@\\
->@@[=--Function
@@@@\\
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
->@@[=
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function post_ad_recap_starter(s,e)=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function update_links(reason)=]@@
->@@@@\\
->@@[=local
@@@@\\
@@[=local function for_all_eps(f)=]@@
->@@[=-------------------------------------------------------------------------------=]@@
->@@@@\\
->@@[=--Okay,
@@[=-------------------------------------------------------------------------------=]@@
@@@@\\
@@[=--Okay, put your executing commands down here.=]@@
Is there an issue? Send a MessageReason:
oh god I'm never going to get it right
Changed line(s) 39 (click to see context) from:
\\
to:
Changed line(s) 52 (click to see context) from:
\\
to:
Changed line(s) 55 (click to see context) from:
\\
to:
Changed line(s) 66 (click to see context) from:
\\
to:
Changed line(s) 73 (click to see context) from:
\\
to:
Changed line(s) 76 (click to see context) from:
\\
to:
Changed line(s) 78 (click to see context) from:
\\
to:
Changed line(s) 83 (click to see context) from:
\\
to:
Changed line(s) 89 (click to see context) from:
\\
to:
Changed line(s) 92 (click to see context) from:
\\
to:
Changed line(s) 95 (click to see context) from:
\\
to:
Changed line(s) 97 (click to see context) from:
\\
to:
Changed line(s) 99 (click to see context) from:
\\
to:
Changed line(s) 108 (click to see context) from:
\\
to:
Changed line(s) 111 (click to see context) from:
\\
to:
Changed line(s) 119 (click to see context) from:
\\
to:
Changed line(s) 125 (click to see context) from:
\\
to:
Changed line(s) 132 (click to see context) from:
\\
to:
Changed line(s) 135 (click to see context) from:
\\
to:
Changed line(s) 137 (click to see context) from:
\\
to:
Changed line(s) 140 (click to see context) from:
\\
to:
Changed line(s) 143 (click to see context) from:
\\
to:
Changed line(s) 147 (click to see context) from:
\\
to:
Changed line(s) 153 (click to see context) from:
\\
to:
Changed line(s) 156 (click to see context) from:
\\
to:
Changed line(s) 163 (click to see context) from:
\\
to:
Changed line(s) 169 (click to see context) from:
\\
to:
Changed line(s) 176 (click to see context) from:
\\
to:
Changed line(s) 180 (click to see context) from:
\\
to:
Changed line(s) 183 (click to see context) from:
->@@[= slines[#slines+1=]][==]=[='\\\\'=]@@
to:
->@@[= slines[#slines+1=]][==]=[='\\\\'=]@@slines[#slines+1=]][==]=[='->@@@@\\\\'=]@@
Changed line(s) 187 (click to see context) from:
\\
to:
Changed line(s) 191 (click to see context) from:
\\
to:
Changed line(s) 195 (click to see context) from:
\\
to:
Changed line(s) 197 (click to see context) from:
\\
to:
Changed line(s) 200 (click to see context) from:
\\
to:
Changed line(s) 203 (click to see context) from:
\\
to:
Changed line(s) 205 (click to see context) from:
\\
to:
Changed line(s) 207 (click to see context) from:
\\
to:
Changed line(s) 211 (click to see context) from:
\\
to:
Changed line(s) 213 (click to see context) from:
\\
to:
Changed line(s) 220 (click to see context) from:
\\
to:
Changed line(s) 222,225 (click to see context) from:
\\
->@@[=push "OK this should be it"=]@@
\\
\\
->@@[=push "OK this should be it"=]@@
\\
\\
to:
->@@[=push
\\
\\
->@@@@\\
->@@@@\\
Changed line(s) 230 (click to see context) from:
\\
to:
Changed line(s) 235 (click to see context) from:
\\
to:
Changed line(s) 299 (click to see context) from:
\\
to:
Changed line(s) 302 (click to see context) from:
\\
to:
Changed line(s) 311 (click to see context) from:
\\
to:
Changed line(s) 320 (click to see context) from:
\\
to:
Changed line(s) 333 (click to see context) from:
\\
to:
Changed line(s) 337 (click to see context) from:
\\
to:
Changed line(s) 345 (click to see context) from:
\\
to:
Changed line(s) 349 (click to see context) from:
\\
to:
Changed line(s) 357 (click to see context) from:
\\
to:
Changed line(s) 375 (click to see context) from:
\\
to:
Changed line(s) 381 (click to see context) from:
\\
to:
Changed line(s) 397 (click to see context) from:
\\
to:
Changed line(s) 403 (click to see context) from:
\\
to:
Changed line(s) 423 (click to see context) from:
\\
to:
Changed line(s) 429 (click to see context) from:
\\
to:
Changed line(s) 431 (click to see context) from:
\\
to:
Changed line(s) 439 (click to see context) from:
\\
to:
Changed line(s) 448 (click to see context) from:
\\
to:
Changed line(s) 459 (click to see context) from:
\\
to:
Changed line(s) 462 (click to see context) from:
\\
to:
Changed line(s) 472 (click to see context) from:
\\
to:
Changed line(s) 493 (click to see context) from:
\\
to:
Changed line(s) 503 (click to see context) from:
\\
to:
Is there an issue? Send a MessageReason:
OK this should be it
Is there an issue? Send a MessageReason:
OK this should be it
Changed line(s) 39 (click to see context) from:
->\\
to:
Changed line(s) 52 (click to see context) from:
->\\
to:
Changed line(s) 55 (click to see context) from:
->\\
to:
Changed line(s) 66 (click to see context) from:
->\\
to:
Changed line(s) 73 (click to see context) from:
->\\
to:
Changed line(s) 76 (click to see context) from:
->\\
to:
Changed line(s) 78 (click to see context) from:
->\\
to:
Changed line(s) 83 (click to see context) from:
->\\
to:
Changed line(s) 89 (click to see context) from:
->\\
to:
Changed line(s) 92 (click to see context) from:
->\\
to:
Changed line(s) 95 (click to see context) from:
->\\
to:
Changed line(s) 97 (click to see context) from:
->\\
to:
Changed line(s) 99 (click to see context) from:
->\\
to:
Changed line(s) 108 (click to see context) from:
->\\
to:
Changed line(s) 111 (click to see context) from:
->\\
to:
Changed line(s) 119 (click to see context) from:
->\\
to:
Changed line(s) 125 (click to see context) from:
->\\
to:
Changed line(s) 132 (click to see context) from:
->\\
to:
Changed line(s) 135 (click to see context) from:
->\\
to:
Changed line(s) 137 (click to see context) from:
->\\
to:
Changed line(s) 140 (click to see context) from:
->\\
to:
Changed line(s) 143 (click to see context) from:
->\\
to:
Changed line(s) 147 (click to see context) from:
->\\
to:
Changed line(s) 153 (click to see context) from:
->\\
to:
Changed line(s) 156 (click to see context) from:
->\\
to:
Changed line(s) 163 (click to see context) from:
->\\
to:
Changed line(s) 169 (click to see context) from:
->\\
to:
Changed line(s) 176 (click to see context) from:
->\\
to:
Changed line(s) 180 (click to see context) from:
->\\
to:
Changed line(s) 183 (click to see context) from:
->@@[= slines[#slines+1=]][==]=[='->\\\\'=]@@
to:
->@@[= slines[#slines+1=]][==]=[='->\\\\'=]@@slines[#slines+1=]][==]=[='\\\\'=]@@
Changed line(s) 187 (click to see context) from:
->\\
to:
Changed line(s) 191 (click to see context) from:
->\\
to:
Changed line(s) 195 (click to see context) from:
->\\
to:
Changed line(s) 197 (click to see context) from:
->\\
to:
Changed line(s) 200 (click to see context) from:
->\\
to:
Changed line(s) 203 (click to see context) from:
->\\
to:
Changed line(s) 205 (click to see context) from:
->\\
to:
Changed line(s) 207 (click to see context) from:
->\\
to:
Changed line(s) 211 (click to see context) from:
->\\
to:
Changed line(s) 213 (click to see context) from:
->\\
to:
Changed line(s) 220 (click to see context) from:
->\\
to:
Changed line(s) 222,225 (click to see context) from:
->\\
->@@[=push "more madness from which there is no escape"=]@@
->\\
->\\
->@@[=push "more madness from which there is no escape"=]@@
->\\
->\\
to:
->@@[=push
->\\
->\\
\\
\\
Changed line(s) 230 (click to see context) from:
->\\
to:
Changed line(s) 235 (click to see context) from:
->\\
to:
Changed line(s) 299 (click to see context) from:
->\\
to:
Changed line(s) 302 (click to see context) from:
->\\
to:
Changed line(s) 311 (click to see context) from:
->\\
to:
Changed line(s) 320 (click to see context) from:
->\\
to:
Changed line(s) 333 (click to see context) from:
->\\
to:
Changed line(s) 337 (click to see context) from:
->\\
to:
Changed line(s) 345 (click to see context) from:
->\\
to:
Changed line(s) 349 (click to see context) from:
->\\
to:
Changed line(s) 357 (click to see context) from:
->\\
to:
Changed line(s) 375 (click to see context) from:
->\\
to:
Changed line(s) 381 (click to see context) from:
->\\
to:
Changed line(s) 397 (click to see context) from:
->\\
to:
Changed line(s) 403 (click to see context) from:
->\\
to:
Changed line(s) 423 (click to see context) from:
->\\
to:
Changed line(s) 429 (click to see context) from:
->\\
to:
Changed line(s) 431 (click to see context) from:
->\\
to:
Changed line(s) 439 (click to see context) from:
->\\
to:
Changed line(s) 448 (click to see context) from:
->\\
to:
Changed line(s) 459 (click to see context) from:
->\\
to:
Changed line(s) 462 (click to see context) from:
->\\
to:
Changed line(s) 472 (click to see context) from:
->\\
to:
Changed line(s) 493 (click to see context) from:
->\\
to:
Changed line(s) 503 (click to see context) from:
->\\
to:
Is there an issue? Send a MessageReason:
more madness from which there is no escape
Changed line(s) 39 (click to see context) from:
\
to:
Changed line(s) 52 (click to see context) from:
\
to:
Changed line(s) 55 (click to see context) from:
\
to:
Changed line(s) 66 (click to see context) from:
\
to:
Changed line(s) 73 (click to see context) from:
\
to:
Changed line(s) 76 (click to see context) from:
\
to:
Changed line(s) 78 (click to see context) from:
\
to:
Changed line(s) 83 (click to see context) from:
\
to:
Changed line(s) 89 (click to see context) from:
\
to:
Changed line(s) 92 (click to see context) from:
\
to:
Changed line(s) 95 (click to see context) from:
\
to:
Changed line(s) 97 (click to see context) from:
\
to:
Changed line(s) 99 (click to see context) from:
\
to:
Changed line(s) 108 (click to see context) from:
\
to:
Changed line(s) 111 (click to see context) from:
\
to:
Changed line(s) 119 (click to see context) from:
\
to:
Changed line(s) 125 (click to see context) from:
\
to:
Changed line(s) 132 (click to see context) from:
\
to:
Changed line(s) 135 (click to see context) from:
\
to:
Changed line(s) 137 (click to see context) from:
\
to:
Changed line(s) 140 (click to see context) from:
\
to:
Changed line(s) 143 (click to see context) from:
\
to:
Changed line(s) 147 (click to see context) from:
\
to:
Changed line(s) 153 (click to see context) from:
\
to:
Changed line(s) 156 (click to see context) from:
\
to:
Changed line(s) 163 (click to see context) from:
\
to:
Changed line(s) 169 (click to see context) from:
\
to:
Changed line(s) 176 (click to see context) from:
\
to:
Changed line(s) 180 (click to see context) from:
\
to:
Changed line(s) 183 (click to see context) from:
->@@[= slines[#slines+1=]][==]=[='\\'=]@@
to:
->@@[= slines[#slines+1=]][==]=[='\\'=]@@slines[#slines+1=]][==]=[='->\\\\'=]@@
Changed line(s) 187 (click to see context) from:
\
to:
Changed line(s) 191 (click to see context) from:
\
to:
Changed line(s) 195 (click to see context) from:
\
to:
Changed line(s) 197 (click to see context) from:
\
to:
Changed line(s) 200 (click to see context) from:
\
to:
Changed line(s) 203 (click to see context) from:
\
to:
Changed line(s) 205 (click to see context) from:
\
to:
Changed line(s) 207 (click to see context) from:
\
to:
Changed line(s) 211 (click to see context) from:
\
to:
Changed line(s) 213 (click to see context) from:
\
to:
Changed line(s) 220 (click to see context) from:
\
to:
Changed line(s) 222 (click to see context) from:
\
to:
Changed line(s) 224,225 (click to see context) from:
\
\
\
to:
\
->\\
Changed line(s) 230 (click to see context) from:
\
to:
Changed line(s) 235 (click to see context) from:
\
to:
Changed line(s) 299 (click to see context) from:
\
to:
Changed line(s) 302 (click to see context) from:
\
to:
Changed line(s) 311 (click to see context) from:
\
to:
Changed line(s) 320 (click to see context) from:
\
to:
Changed line(s) 333 (click to see context) from:
\
to:
Changed line(s) 337 (click to see context) from:
\
to:
Changed line(s) 345 (click to see context) from:
\
to:
Changed line(s) 349 (click to see context) from:
\
to:
Changed line(s) 357 (click to see context) from:
\
to:
Changed line(s) 375 (click to see context) from:
\
to:
Changed line(s) 381 (click to see context) from:
\
to:
Changed line(s) 397 (click to see context) from:
\
to:
Changed line(s) 403 (click to see context) from:
\
to:
Changed line(s) 423 (click to see context) from:
\
to:
Changed line(s) 429 (click to see context) from:
\
to:
Changed line(s) 431 (click to see context) from:
\
to:
Changed line(s) 439 (click to see context) from:
\
to:
Changed line(s) 448 (click to see context) from:
\
to:
Changed line(s) 459 (click to see context) from:
\
to:
Changed line(s) 462 (click to see context) from:
\
to:
Changed line(s) 472 (click to see context) from:
\
to:
Changed line(s) 493 (click to see context) from:
\
to:
Changed line(s) 503 (click to see context) from:
\
to:
Is there an issue? Send a MessageReason:
more madness from which there is no escape
Changed line(s) 39 (click to see context) from:
->\
to:
Changed line(s) 52 (click to see context) from:
->\
to:
Changed line(s) 55 (click to see context) from:
->\
to:
Changed line(s) 66 (click to see context) from:
->\
to:
Changed line(s) 73 (click to see context) from:
->\
to:
Changed line(s) 76 (click to see context) from:
->\
to:
Changed line(s) 78 (click to see context) from:
->\
to:
Changed line(s) 83 (click to see context) from:
->\
to:
Changed line(s) 89 (click to see context) from:
->\
to:
Changed line(s) 92 (click to see context) from:
->\
to:
Changed line(s) 95 (click to see context) from:
->\
to:
Changed line(s) 97 (click to see context) from:
->\
to:
Changed line(s) 99 (click to see context) from:
->\
to:
Changed line(s) 108 (click to see context) from:
->\
to:
Changed line(s) 111 (click to see context) from:
->\
to:
Changed line(s) 119 (click to see context) from:
->\
to:
Changed line(s) 125 (click to see context) from:
->\
to:
Changed line(s) 132 (click to see context) from:
->\
to:
Changed line(s) 135 (click to see context) from:
->\
to:
Changed line(s) 137 (click to see context) from:
->\
to:
Changed line(s) 140 (click to see context) from:
->\
to:
Changed line(s) 143 (click to see context) from:
->\
to:
Changed line(s) 147 (click to see context) from:
->\
to:
Changed line(s) 153 (click to see context) from:
->\
to:
Changed line(s) 156 (click to see context) from:
->\
to:
Changed line(s) 163 (click to see context) from:
->\
to:
Changed line(s) 169 (click to see context) from:
->\
to:
Changed line(s) 176 (click to see context) from:
->\
to:
Changed line(s) 180 (click to see context) from:
->\
to:
Changed line(s) 183 (click to see context) from:
->@@[= slines[#slines+1=]][==]=[='->\\'=]@@
to:
->@@[= slines[#slines+1=]][==]=[='->\\'=]@@slines[#slines+1=]][==]=[='\\'=]@@
Changed line(s) 187 (click to see context) from:
->\
to:
Changed line(s) 191 (click to see context) from:
->\
to:
Changed line(s) 195 (click to see context) from:
->\
to:
Changed line(s) 197 (click to see context) from:
->\
to:
Changed line(s) 200 (click to see context) from:
->\
to:
Changed line(s) 203 (click to see context) from:
->\
to:
Changed line(s) 205 (click to see context) from:
->\
to:
Changed line(s) 207 (click to see context) from:
->\
to:
Changed line(s) 211 (click to see context) from:
->\
to:
Changed line(s) 213 (click to see context) from:
->\
to:
Changed line(s) 220 (click to see context) from:
->\
to:
Changed line(s) 222 (click to see context) from:
->\
to:
Changed line(s) 224,225 (click to see context) from:
->\
->\
->\
to:
->\
\
Changed line(s) 230 (click to see context) from:
->\
to:
Changed line(s) 235 (click to see context) from:
->\
to:
Changed line(s) 299 (click to see context) from:
->\
to:
Changed line(s) 302 (click to see context) from:
->\
to:
Changed line(s) 311 (click to see context) from:
->\
to:
Changed line(s) 320 (click to see context) from:
->\
to:
Changed line(s) 333 (click to see context) from:
->\
to:
Changed line(s) 337 (click to see context) from:
->\
to:
Changed line(s) 345 (click to see context) from:
->\
to:
Changed line(s) 349 (click to see context) from:
->\
to:
Changed line(s) 357 (click to see context) from:
->\
to:
Changed line(s) 375 (click to see context) from:
->\
to:
Changed line(s) 381 (click to see context) from:
->\
to:
Changed line(s) 397 (click to see context) from:
->\
to:
Changed line(s) 403 (click to see context) from:
->\
to:
Changed line(s) 423 (click to see context) from:
->\
to:
Changed line(s) 429 (click to see context) from:
->\
to:
Changed line(s) 431 (click to see context) from:
->\
to:
Changed line(s) 439 (click to see context) from:
->\
to:
Changed line(s) 448 (click to see context) from:
->\
to:
Changed line(s) 459 (click to see context) from:
->\
to:
Changed line(s) 462 (click to see context) from:
->\
to:
Changed line(s) 472 (click to see context) from:
->\
to:
Changed line(s) 493 (click to see context) from:
->\
to:
Changed line(s) 503 (click to see context) from:
->\
to:
Is there an issue? Send a MessageReason:
more madness from which there is no escape
Changed line(s) 38,67 (click to see context) from:
@@[=local urlencode=]=[={}=]@@
@@[==]@@
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= --Ensure all newlines are in CRLF form=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[=~ =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
@@[==]@@
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
@@[==]@@
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= --table of argument strings=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
@@[=end=]@@
@@[==]@@
@@[=return urlencode=]@@
@@[==]@@
@@[=--URL encode a string.=]@@
@@[=local function encode(str)=]@@
@@[= --Ensure all newlines are in CRLF form=]@@
@@[= str =]=[= string.gsub (str, "\r?\n", "\r\n")=]@@
@@[= --Percent-encode all non-unreserved characters=]@@
@@[= --as per RFC 3986, Section 2.3=]@@
@@[= --(except for space, which gets plus-encoded)=]@@
@@[= str =]=[= string.gsub (str, "([^=]%[=w=]%[=-=]%[=.=]%[=_=]%[=~ =]][=)",=]@@
@@[= function (c) return string.format ("=]%[==]%[==]%[=02X", string.byte(c)) end)=]@@
@@[= --Convert spaces to plus signs=]@@
@@[= return string.gsub (str, " ", "+")=]@@
@@[=end=]@@
@@[==]@@
@@[=--Make this function available as part of the module=]@@
@@[=urlencode.string =]=[= encode=]@@
@@[==]@@
@@[=--URL encode a table as a series of parameters.=]@@
@@[=function urlencode.table(t)=]@@
@@[= --table of argument strings=]@@
@@[= local argts, i=]=[= {}, 1=]@@
@@[= for k, v in pairs(t) do=]@@
@@[= argts[i=]][==]=[=encode(k).."=]=[="..encode(v)=]@@
@@[= i=]=[=i+1=]@@
@@[= end=]@@
@@[= return table.concat(argts,'&')=]@@
@@[=end=]@@
@@[==]@@
@@[=return urlencode=]@@
to:
@@[=--URL
->@@[=--URL encode a string.=]@@
@@[==]@@
@@[=--Make
->\
->@@[=--Make this function available as part of the module=]@@
@@[=--URL
->@@[=--URL encode a table as a series of parameters.=]@@
@@[==]@@
@@[=return
->\
->@@[=return urlencode=]@@
Changed line(s) 71,148 (click to see context) from:
@@[=--Required to send to TVTropes site.=]@@
@@[=local http =]=[= require"socket.http"=]@@
@@[==]@@
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
@@[==]@@
@@[=local tvtropes=]=[={}=]@@
@@[==]@@
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
@@[==]@@
@@[=local function fullname(page)=]@@
@@[= --Require pagename=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
@@[==]@@
@@[= return page=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
@@[==]@@
@@[= page=]=[=fullname(page)=]@@
@@[==]@@
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
@@[==]@@
@@[= local response =]=[==]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
@@[==]@@
@@[= --Error on any socket errors=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
@@[==]@@
@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)~=]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
@@[==]@@
@@[= function html2plain(src)=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
@@[==]@@
@@[= page=]=[=fullname(page)=]@@
@@[==]@@
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[==]@@
@@[= --Trigger error on socket failure=]@@
@@[= assert(body,code)=]@@
@@[==]@@
@@[= --Return the source converted back from the HTML conversion=]@@
@@[= return html2plain(body)=]@@
@@[=end=]@@
@@[==]@@
@@[=return tvtropes=]@@
@@[=local http =]=[= require"socket.http"=]@@
@@[==]@@
@@[=--Required to create page post data.=]@@
@@[=local urlencode =]=[= require "urlencode"=]@@
@@[==]@@
@@[=local tvtropes=]=[={}=]@@
@@[==]@@
@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[=local function authpageurl(page)=]@@
@@[= return "http://:foamy@tvtropes.org/pmwiki/pmwiki.php/"..page=]@@
@@[=end=]@@
@@[==]@@
@@[=local function fullname(page)=]@@
@@[= --Require pagename=]@@
@@[= assert(type(page)=]=[==]=[="string","Destination page name required")=]@@
@@[= --If no namespace specified, assume Main=]@@
@@[= if not string.find(page,'/') then page=]=[="Main/"..page end=]@@
@@[==]@@
@@[= return page=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that posts the given page.=]@@
@@[=function tvtropes.post(page, body, author, reason)=]@@
@@[==]@@
@@[= page=]=[=fullname(page)=]@@
@@[==]@@
@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
@@[==]@@
@@[= local response =]=[==]@@
@@[= {http.request(authpageurl(page),=]@@
@@[= urlencode.table{=]@@
@@[= action=]=[="post", post=]=[="save",=]@@
@@[= pagename=]=[=page, text=]=[=body,=]@@
@@[= author=]=[=author or "Anonymous",=]@@
@@[= reason=]=[=reason or ""=]@@
@@[= })}=]@@
@@[==]@@
@@[= --Error on any socket errors=]@@
@@[= assert(response[1=]][=,response[2=]][=)=]@@
@@[==]@@
@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
@@[= --sometimes it just rejects the password for some reason.=]@@
@@[= if tonumber(response[2=]][=)~=]=[=302 then=]@@
@@[= return nil, response[2=]][=, response[1=]][==]@@
@@[= else return true=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=--TVTropes' source converter, so it's kept in here.=]@@
@@[=local html2plain=]@@
@@[=do=]@@
@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
@@[==]@@
@@[= function html2plain(src)=]@@
@@[= src=]=[=string.gsub(src,"<br/>","\n")=]@@
@@[= src=]=[=string.gsub(src,"&(=]%[=w-);",ents)=]@@
@@[= return src=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that gets a given page source.=]@@
@@[=function tvtropes.get(page)=]@@
@@[==]@@
@@[= page=]=[=fullname(page)=]@@
@@[==]@@
@@[= local body, code =]=[= http.request(=]@@
@@[= authpageurl(page)..'?action=]=[=source')=]@@
@@[==]@@
@@[= --Trigger error on socket failure=]@@
@@[= assert(body,code)=]@@
@@[==]@@
@@[= --Return the source converted back from the HTML conversion=]@@
@@[= return html2plain(body)=]@@
@@[=end=]@@
@@[==]@@
@@[=return tvtropes=]@@
to:
@@[=--Required
->@@[=--Required to create page post data.=]@@
@@[=local
->@@[=local tvtropes=]=[={}=]@@
@@[=--Function
->@@[=--Function that returns the authenticated TVTropes URL for the given page.=]@@
@@[==]@@
@@[=local
->\
->@@[=local function fullname(page)=]@@
@@[=
->@@[= return page=]@@
@@[==]@@
@@[=--Function
->\
->@@[=--Function that posts the given page.=]@@
@@[=
->@@[= page=]=[=fullname(page)=]@@
@@[=
->@@[= assert(type(body)=]=[==]=[="string","Page body required")=]@@
@@[=
->@@[= local response =]=[==]@@
@@[=
->@@[= --Error on any socket errors=]@@
@@[=
->@@[= --If it doesn't return Found, return nil, the status, and the body:=]@@
@@[==]@@
@@[=--Technically,
->\
->@@[=--Technically, this is kind of a general function, but it's designed exclusively around=]@@
@@[=
->@@[= local ents =]=[= {quot=]=[='"', amp=]=[='&', lt=]=[='<', gt=]=[='>'}=]@@
@@[=
->@@[= function html2plain(src)=]@@
@@[==]@@
@@[=--Function
->\
->@@[=--Function that gets a given page source.=]@@
@@[=
->@@[= page=]=[=fullname(page)=]@@
@@[=
->@@[= local body, code =]=[= http.request(=]@@
@@[=
->@@[= --Trigger error on socket failure=]@@
@@[=
->@@[= --Return the source converted back from the HTML conversion=]@@
@@[==]@@
@@[=return
->\
->@@[=return tvtropes=]@@
Changed line(s) 152,221 (click to see context) from:
@@[=local tvtropes =]=[= require "tvtropes"=]@@
@@[==]@@
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[==]@@
@@[=local scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
@@[==]@@
@@[=local function scriptfolder(name,script)=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
@@[==]@@
@@[=local function revsection()=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
@@[==]@@
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[==]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[==]@@
@@[= slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= end=]@@
@@[==]@@
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
@@[==]@@
@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
@@[==]@@
@@[= return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
@@[==]@@
@@[=local function push(notes)=]@@
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[==]@@
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
@@[==]@@
@@[= local current=]=[=tvtropes.get(target)=]@@
@@[==]@@
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
@@[==]@@
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
@@[==]@@
@@[= local posted=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Executing code---------------------------------------------------------------=]@@
@@[==]@@
@@[=push "more madness from which there is no escape"=]@@
@@[==]@@
@@[==]@@
@@[==]@@
@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local user=]=[="STUART"=]@@
@@[==]@@
@@[=local scripts=]=[={=]@@
@@[= "urlencode.lua",=]@@
@@[= "tvtropes.lua",=]@@
@@[= "tropersrepo.lua",=]@@
@@[= "arrdev_recap.lua",=]@@
@@[=}=]@@
@@[==]@@
@@[=local function scriptfolder(name,script)=]@@
@@[= return string.format(=]@@
@@[= "[[folder:=]%[=s=]][==]][=\n=]%[=s\n[[/folder=]][==]][=",=]@@
@@[= name,script)=]@@
@@[=end=]@@
@@[==]@@
@@[=local function revsection()=]@@
@@[= local folders=]=[={=]@@
@@[= "=]%[==]%[=STARTSCRIPTS=]%[==]%[=",=]@@
@@[= "[[foldercontrol=]][==]][="=]@@
@@[= }=]@@
@@[= local headers=]=[=#folders=]@@
@@[==]@@
@@[= for i=]=[=1, #scripts do=]@@
@@[= local slines=]=[={}=]@@
@@[= for line in io.lines(scripts[i=]][=) do=]@@
@@[==]@@
@@[= --escape all equals signs and percents=]@@
@@[= local escaped=]=[=string.gsub(line,"[=]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[= function(char) return string.format("=]=[==]][=&#=]%[=i;[=]=[=",string.byte(char)) end)=]@@
@@[==]@@
@@[= slines[#slines+1=]][==]=[=string.format("@@[=]=[==]%[=s=]=[==]][=@@",escaped)=]@@
@@[= end=]@@
@@[==]@@
@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[= folders[i+headers=]][==]=[=scriptfolder(scripts[i=]][=,content)=]@@
@@[= end=]@@
@@[==]@@
@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
@@[==]@@
@@[= return table.concat(folders,"\n\n")=]@@
@@[=end=]@@
@@[==]@@
@@[=local function push(notes)=]@@
@@[= local gssscripts=]=[=string.gsub(revsection(),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[==]@@
@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
@@[==]@@
@@[= local current=]=[=tvtropes.get(target)=]@@
@@[==]@@
@@[= local updated=]=[=string.gsub(current,=]@@
@@[= "=]%[==]%[==]%[==]%[=STARTSCRIPTS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDSCRIPTS=]%[==]%[==]%[==]%[=",=]@@
@@[= gssscripts)=]@@
@@[==]@@
@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
@@[==]@@
@@[= local posted=]@@
@@[= while not posted do=]@@
@@[= posted=]=[=tvtropes.post(target,updated,user,notes)=]@@
@@[= if not posted then print" Retrying..." end=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Executing code---------------------------------------------------------------=]@@
@@[==]@@
@@[=push "more madness from which there is no escape"=]@@
@@[==]@@
@@[==]@@
to:
@@[=local
->@@[=local target =]=[= "Tropers/STUART"=]@@
@@[=local
->@@[=local scripts=]=[={=]@@
@@[==]@@
@@[=local
->\
->@@[=local function scriptfolder(name,script)=]@@
@@[==]@@
@@[=local
->\
->@@[=local function revsection()=]@@
@@[=
->@@[= for i=]=[=1, #scripts do=]@@
@@[=
->@@[= --escape all equals signs and percents=]@@
->@@[= slines[#slines+1=]][==]=[='->\\'=]@@
->@@[= else=]@@
->@@[= local escaped=]=[=string.gsub(line,"[=]%[==]=[==]%[==]][==]%[==]%[==]][=",=]@@
@@[=
->@@[= slines[#slines+1=]][==]=[=string.
@@[=
->@@[= end=]@@
@@[=
->\
->@@[= local content=]=[=table.concat(slines,'\n')=]@@
@@[=
->@@[= folders[#folders+1=]][==]=[="=]%[==]%[=ENDSCRIPTS=]%[==]%[="=]@@
@@[=
->@@[= return table.concat(folders,"\n\n")=]@@
@@[==]@@
@@[=local
->\
->@@[=local function push(notes)=]@@
@@[=
->@@[= print(string.format("Getting current version of =]%[=s...",target))=]@@
@@[=
->@@[= local current=]=[=tvtropes.get(target)=]@@
@@[=
->@@[= local updated=]=[=string.gsub(current,=]@@
@@[=
->@@[= print(string.format("Posting new version of =]%[=s...",target))=]@@
@@[=
->@@[= local posted=]@@
@@[==]@@
@@[=--Executing
->\
->@@[=--Executing code---------------------------------------------------------------=]@@
@@[=push
->@@[=push "more madness from which there is no escape"=]@@
@@[==]@@
->\
Changed line(s) 225,500 (click to see context) from:
@@[=--encoding: UTF-8=]@@
@@[==]@@
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
@@[==]@@
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
@@[==]@@
@@[=do --wikipedia=]@@
@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
@@[==]@@
@@[= --construct lookup table=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
@@[==]@@
@@[= --Function that returns the Wikipedia URL=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
@@[==]@@
@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Balboa Observer-Picayune=]@@
@@[= --Season 1 episodes that are listed at different numbers=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
@@[==]@@
@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
@@[==]@@
@@[= --Function that returns the URL for the episode's IMDB page=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Hulu, you know, just in case=]@@
@@[= local watchnums=]=[={=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
@@[==]@@
@@[= function tokens.hulu(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Netflix Watch Instantly=]@@
@@[= --It's largely sequential, but not quite.=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
@@[==]@@
@@[= function tokens.netflix(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
@@[==]@@
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= --get the ep title=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
@@[==]@@
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
@@[==]@@
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= return tvtropes.post(=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
@@[==]@@
@@[=local function update_links(reason)=]@@
@@[= return function(s,e)=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=local function for_all_eps(f)=]@@
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Okay, put your executing commands down here.=]@@
@@[==]@@
@@[=--Required to post pages=]@@
@@[=local tvtropes=]=[=require "tvtropes"=]@@
@@[=--Required for encoding Wikipedia article titles=]@@
@@[=local urlencode=]=[=require "urlencode"=]@@
@@[==]@@
@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=adeps=]=[={=]@@
@@[= {=]@@
@@[= "Pilot",=]@@
@@[= "Top Banana",=]@@
@@[= "Bringing Up Buster",=]@@
@@[= "Key Decisions",=]@@
@@[= "Visiting Ours",=]@@
@@[= "Charity Drive",=]@@
@@[= "My Mother, The Car",=]@@
@@[= "In God We Trust",=]@@
@@[= "Storming the Castle",=]@@
@@[= "Pier Pressure",=]@@
@@[= "Public Relations",=]@@
@@[= "Marta Complex",=]@@
@@[= "Beef Consommé",=]@@
@@[= "Shock and Aww",=]@@
@@[= "Staff Infection",=]@@
@@[= "Missing Kitty",=]@@
@@[= "Altar Egos",=]@@
@@[= "Justice Is Blind",=]@@
@@[= "Best Man for the GOB",=]@@
@@[= "Whistler's Mother",=]@@
@@[= "Not Without My Daughter",=]@@
@@[= "Let 'Em Eat Cake"=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The One Where Michael Leaves",=]@@
@@[= "The One Where They Build a House",=]@@
@@[= "¡Amigos!",=]@@
@@[= "Good Grief",=]@@
@@[= "Sad Sack",=]@@
@@[= "Afternoon Delight",=]@@
@@[= "Switch Hitter",=]@@
@@[= "Queen for a Day",=]@@
@@[= "Burning Love",=]@@
@@[= "Ready, Aim, Marry Me",=]@@
@@[= "Out on a Limb",=]@@
@@[= "Hand to God",=]@@
@@[= "Motherboy XXX",=]@@
@@[= "The Immaculate Election",=]@@
@@[= "Sword of Destiny",=]@@
@@[= "Meat the Veals",=]@@
@@[= "Spring Breakout",=]@@
@@[= "Righteous Brothers",=]@@
@@[= },=]@@
@@[= {=]@@
@@[= "The Cabin Show",=]@@
@@[= "For British Eyes Only",=]@@
@@[= "Forget-Me-Now",=]@@
@@[= "Notapusy",=]@@
@@[= "Mr. F",=]@@
@@[= "The Ocean Walker",=]@@
@@[= "Prison Break-In",=]@@
@@[= "Making a Stand",=]@@
@@[= "S.O.B.s",=]@@
@@[= "Fakin' It",=]@@
@@[= "Family Ties",=]@@
@@[= "Exit Strategy",=]@@
@@[= "Development Arrested"=]@@
@@[= },=]@@
@@[=}=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=local tokens=]=[={}=]@@
@@[==]@@
@@[=do --wikipedia=]@@
@@[= --Numbers for episodes with ambiguous titles, Wikipedia-wise,=]@@
@@[= --whose article titles end with "(Arrested Development)"=]@@
@@[= local disambigeps=]=[={=]@@
@@[= {1,2,8,11,20,21,22}, --Season 1=]@@
@@[= {5,6,8,9,11,12,18}, --Season 2=]@@
@@[= {10,11,12} --Season 3=]@@
@@[= }=]@@
@@[==]@@
@@[= --construct lookup table=]@@
@@[= local disambiguated=]=[={}=]@@
@@[= for s=]=[=1,#disambigeps do=]@@
@@[= disambiguated[s=]][==]=[={}=]@@
@@[= for i=]=[=1,#disambigeps[s=]][= do=]@@
@@[= disambiguated[s=]][=[disambigeps[s=]][=[i=]][==]][==]=[=true=]@@
@@[= end=]@@
@@[= end=]@@
@@[==]@@
@@[= --Function that returns the Wikipedia URL=]@@
@@[= function tokens.wikipedia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= if disambiguated[s=]][=[e=]][= then=]@@
@@[= --Technically, parentheses don't have to be percent-encoded=]@@
@@[= --for HTTP URIs because they're unused sub-delims=]@@
@@[= --per section 2.2 of RFC 3986, so we concatenate after=]@@
@@[= --the function that percent-encodes all sub-delims=]@@
@@[= pagename=]=[=pagename.."_(Arrested_Development)"=]@@
@@[= end=]@@
@@[==]@@
@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[=function tokens.wikia(s,e)=]@@
@@[= local pagename=]=[=adeps[s=]][=[e=]][==]@@
@@[= pagename=]=[=string.gsub(pagename,' ','_')=]@@
@@[= pagename=]=[=urlencode.string(pagename)=]@@
@@[= return "http://arresteddevelopment.wikia.com/wiki/"..pagename=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Balboa Observer-Picayune=]@@
@@[= --Season 1 episodes that are listed at different numbers=]@@
@@[= local s1flips=]=[={ [5=]][==]=[=6, [6=]][==]=[=5, [7=]][==]=[=8, [8=]][==]=[=7, [16=]][==]=[=18, [17=]][==]=[=16, [18=]][==]=[=17 }=]@@
@@[==]@@
@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
@@[= function tokens.theop(s,e)=]@@
@@[= --correct OutOfOrder Season 1 episodes=]@@
@@[= if s=]=[==]=[=1 then e =]=[= s1flips[e=]][= or e end=]@@
@@[= return string.format("http://the-op.com/episode/=]%[=i=]%[=02i",s,e)=]@@
@@[= end=]@@
@@[=end=]@@
\\
@@[=do --IMDB=]@@
@@[= --why hello, unreadable block of arbitrary indices, it sure sucks=]@@
@@[= --that I have to use you=]@@
@@[= local ttnums=]=[={=]@@
@@[= { 0515236, 0515256, 0515212, 0515223, 0515257,=]@@
@@[= 0515214, 0515231, 0515221, 0515247, 0515235,=]@@
@@[= 0515238, 0515226, 0515210, 0515244, 0515246,=]@@
@@[= 0515228, 0515208, 0515222, 0515211, 0515258,=]@@
@@[= 0515232, 0515224, },=]@@
@@[= { 0515253, 0515254, 0515209, 0515219, 0515243,=]@@
@@[= 0515207, 0515248, 0515239, 0515213, 0515240,=]@@
@@[= 0515234, 0515220, 0515229, 0515251, 0515255,=]@@
@@[= 0515227, 0515245, 0515241, },=]@@
@@[= { 0515250, 0515249, 0515218, 0515233, 0515230,=]@@
@@[= 0515252, 0515237, 0515225, 0515242, 0515216,=]@@
@@[= 0515217, 0515215, 0757386, }=]@@
@@[= }=]@@
@@[==]@@
@@[= --Function that returns the URL for the episode's IMDB page=]@@
@@[= function tokens.imdb(s,e)=]@@
@@[= return string.format("http://www.imdb.com/title/tt=]%[=07i/",ttnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Hulu, you know, just in case=]@@
@@[= local watchnums=]=[={=]@@
@@[= { 589, 1786, 585, 1781, 1785,=]@@
@@[= 580, 590, 588, 586, 575,=]@@
@@[= 576, 579, 577, 644, 1783,=]@@
@@[= 591, 582, 584, 578, 581,=]@@
@@[= 583, 587},=]@@
@@[= { 6641, 6644, 6643, 6638, 6639,=]@@
@@[= 12883, 13226, 12561, 12609, 12298,=]@@
@@[= 12271, 12901, 13248, 13267, 13276,=]@@
@@[= 13206, 12232, 12532},=]@@
@@[= { 6640, 6642, 6635, 6636, 6637,=]@@
@@[= 12497, 17189, 12523, 13139, 12225,=]@@
@@[= 12317, 12194, 12215},=]@@
@@[= }=]@@
@@[==]@@
@@[= function tokens.hulu(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://hulu.com/watch/=]%[=i", watchnums[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=do --Netflix Watch Instantly=]@@
@@[= --It's largely sequential, but not quite.=]@@
@@[= --I printed out all the numbers and moved them around=]@@
@@[= --to fit the correct order (which is both inconsistent=]@@
@@[= --in IDs to Netflix order and Netflix to DVD order).=]@@
@@[= local movieids=]=[={=]@@
@@[= { 70133673, 70133674, 70133675, 70133677, 70133676,=]@@
@@[= 70133678, 70133680, 70133679, 70133681, 70133682,=]@@
@@[= 70133683, 70133684, 70133685, 70133686, 70133687,=]@@
@@[= 70133688, 70133689, 70133690, 70133691, 70133692,=]@@
@@[= 70133693, 70133694, },=]@@
@@[= { 70133695, 70133696, 70133697, 70133698, 70133699,=]@@
@@[= 70133700, 70133701, 70133702, 70133703, 70133704,=]@@
@@[= 70133705, 70133706, 70133707, 70133708, 70133711,=]@@
@@[= 70133709, 70133710, 70133712, },=]@@
@@[= { 70133713, 70133714, 70133715, 70133716, 70133717,=]@@
@@[= 70133718, 70133720, 70133719, 70133721, 70133722,=]@@
@@[= 70133723, 70133724, 70133725, }=]@@
@@[= }=]@@
@@[==]@@
@@[= function tokens.netflix(s,e)=]@@
@@[= return string.format(=]@@
@@[= "http://www.netflix.com/WiPlayer?movieid=]=[==]%[=i",movieids[s=]][=[e=]][=)=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=local ad_ep_links=]@@
@@[=do=]@@
@@[= local template=]=[=[=]=[=[=]@@
@@[==]%[==]%[=STARTLINKS=]%[==]%[==]@@
@@[=----=]@@
@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
@@[==]@@
@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[=----=]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[= function ad_ep_links(s,e)=]@@
@@[= return (string.gsub(template,"=]%[=$(=]%[=w+)",function(token) return tokens[token=]][=(s,e) end))=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=local function recap_pagename(s,e)=]@@
@@[= --get the ep title=]@@
@@[= local title=]=[=adeps[s=]][=[e=]][==]@@
@@[= --replace the é in Beef Consommé=]@@
@@[= title=]=[=string.gsub(title,'é','e')=]@@
@@[= --transform to CamelCased WikiWord=]@@
@@[= title=]=[=string.gsub(title,' (=]%[=l?)',string.upper)=]@@
@@[= --Remove all non-alphanumeric characters=]@@
@@[= title=]=[=string.gsub(title,'=]%[=W','')=]@@
@@[==]@@
@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[=end=]@@
@@[==]@@
@@[=local function post_ad_recap_starter(s,e)=]@@
@@[= return tvtropes.post(=]@@
@@[= recap_pagename(s,e),=]@@
@@[= string.format(=]@@
@@[= "\n\n=]%[=s\n!The ''ArrestedDevelopment'' episode \"=]%[=s\" provides examples of:\n\n",=]@@
@@[= ad_ep_links(s,e),adeps[s=]][=[e=]][=),=]@@
@@[= "STUART",=]@@
@@[= "Adding interwiki links and example header automatically (Ask me about Lua)")=]@@
@@[=end=]@@
@@[==]@@
@@[=local function update_links(reason)=]@@
@@[= return function(s,e)=]@@
@@[= --until comment syntax is changed, Amigos is manual-only=]@@
@@[= if s=]=[==]=[=2 and e=]=[==]=[=3 then=]@@
@@[= print "(Skipping Amigos because the links go all screwy)"=]@@
@@[= else=]@@
@@[= local pagename=]=[=recap_pagename(s,e)=]@@
@@[= local pageasis=]=[=tvtropes.get(pagename)=]@@
@@[= local gsubsafelinks =]=[= string.gsub(ad_ep_links(s,e),"=]%[==]%[=","=]%[==]%[==]%[==]%[=")=]@@
@@[= local success=]@@
@@[= while not success do=]@@
@@[= local code=]@@
@@[= success, code =]=[= tvtropes.post(pagename,=]@@
@@[= string.gsub(pageasis,"=]%[==]%[==]%[==]%[=STARTLINKS=]%[==]%[==]%[==]%[=.-=]%[==]%[==]%[==]%[=ENDLINKS=]%[==]%[==]%[==]%[=",gsubsafelinks),=]@@
@@[= "STUART",reason)=]@@
@@[= if not success then print("Retrying... "..code) end=]@@
@@[= end=]@@
@@[= end=]@@
@@[= end=]@@
@@[=end=]@@
@@[==]@@
@@[=local function for_all_eps(f)=]@@
@@[= for s=]=[=1,#adeps do=]@@
@@[= for e=]=[=1,#adeps[s=]][= do=]@@
@@[= print(string.format('Doing Season =]%[=i Episode =]%[=i, "=]%[=s"...',s,e,adeps[s=]][=[e=]][=))=]@@
@@[= f(s,e)=]@@
@@[= end=]@@
@@[= end=]@@
@@[=end=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Okay, put your executing commands down here.=]@@
to:
@@[=--Required
->@@[=--Required to post pages=]@@
@@[=--Arrested
->@@[=--Arrested Development data----------------------------------------------------=]@@
@@[=
->@@[= {=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Interwiki
->@@[=-------------------------------------------------------------------------------=]@@
->\
->@@[=--Interwiki data---------------------------------------------------------------=]@@
@@[=do
->@@[=do --wikipedia=]@@
@@[=
->@@[= --construct lookup table=]@@
@@[=
->@@[= --Function that returns the Wikipedia URL=]@@
@@[=
->@@[= return "http://en.wikipedia.org/wiki/"..pagename=]@@
@@[==]@@
@@[=--Function
->\
->@@[=--Function that returns the URL of the Arrested Development Wikia entry=]@@
@@[==]@@
@@[=do
->\
->@@[=do --Balboa Observer-Picayune=]@@
@@[=
->@@[= --Function the returns the URL of the episode's page on the-op.com=]@@
\\
@@[=do
->\
->@@[=do --IMDB=]@@
@@[=
->@@[= --Function that returns the URL for the episode's IMDB page=]@@
@@[==]@@
@@[=do
->\
->@@[=do --Hulu, you know, just in case=]@@
@@[=
->@@[= function tokens.hulu(s,e)=]@@
@@[==]@@
@@[=do
->\
->@@[=do --Netflix Watch Instantly=]@@
@@[=
->@@[= function tokens.netflix(s,e)=]@@
@@[==]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Arrested
->\
->@@[=-------------------------------------------------------------------------------=]@@
->\
->@@[=--Arrested Development TV Tropes Recap stuff-----------------------------------=]@@
@@[=
->@@[= local template=]=[=[=]=[=[=]@@
@@[=----=]@@
@@[=Interwiki:
->@@[=----=]@@
->@@[=Interwiki: [[$wikipedia Wikipedia=]][==]][= -- [[$wikia Wikia=]][==]][= -- [[$theop Balboa Observer-Picayune=]][==]][= -- [[$imdb IMDB=]][==]][==]@@
@@[=Watch
->@@[=Watch now: [[$hulu Hulu=]][==]][= -- [[$netflix Netflix=]][==]][==]@@
@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
@@[==]][==]=[==]][==]@@
@@[=
->@@[==]%[==]%[=ENDLINKS=]%[==]%[==]@@
->@@[==]][==]=[==]][==]@@
->@@[= function ad_ep_links(s,e)=]@@
@@[==]@@
@@[=--Function
->\
->@@[=--Function that returns the page name of the episode's TVTropes Recap page.=]@@
@@[=
->@@[= return string.format("Recap/ArrestedDevelopmentS=]%[=iE=]%[=i=]%[=s",s,e,title)=]@@
@@[==]@@
@@[=local
->\
->@@[=local function post_ad_recap_starter(s,e)=]@@
@@[==]@@
@@[=local
->\
->@@[=local function update_links(reason)=]@@
@@[==]@@
@@[=local
->\
->@@[=local function for_all_eps(f)=]@@
@@[=-------------------------------------------------------------------------------=]@@
@@[==]@@
@@[=--Okay,
->@@[=-------------------------------------------------------------------------------=]@@
->\
->@@[=--Okay, put your executing commands down here.=]@@