use somthing like
find iWeb/ -iname '*.html' -exec ./iWeb.py "</body>" iWeb.analytics {} {} \;with iWeb.analytics beeing the Google snippet and iWeb.py the follwoing script. after that i use sitecopy --update [SITENAME]...
#!/usr/bin/env pythonthe latest version of this script might be available from (something like):
import sys,os
usage = "usage: %s searchText insertText_file [infile [outfile]]" % os.path.basename(sys.argv[0])
def init():
stext = sys.argv[1]
replaceTextFileIn = open(sys.argv[2],'r')
replaceTextFileContent = replaceTextFileIn.readlines()
replaceTextFileIn.close()
# print replaceTextFileContent
input = sys.stdin
output = sys.stdout
if len(sys.argv) > 3:
input = open(sys.argv[3])
inputContent = input.readlines()
input.close()
if len(sys.argv) > 4:
output = open(sys.argv[4], 'w')
for s in inputContent:
output.write(s.replace(stext, ''.join(replaceTextFileContent) + stext))
output.close()
if __name__ == "__main__":
if len(sys.argv)
https: / / iiegn.dyndns.org / svn / de.iiegn / _stuff / iWeb.py
references:
No comments:
Post a Comment