jeudi 25 octobre 2007
taginserter le script qui insert des tags ....
Par Philippe Mironov, jeudi 25 octobre 2007 :: Open Yeti
Voici un de ces script qui ne servent qu'une fois... mais bon peut être celui-ci peut vous servir. Je l'ai écrit pour inserer un code google analytics sur un site avec 77 pages html statiques.
#!/usr/bin/env python # AUTHOR : Philippe Mironov# LICENCE : GPLv2+ #inserts tag_to_insert before tag_before in every file in CWD in ext # checks if tag_to_insert and tag_check are not already in file # skips files without tag_before in them. # Can be used to add insert statements or for exemple google analytics code in an old static website. ext = "html" tag_to_insert = """""" tag_before = "