Molten Syntax Projects

Web Album Generator is a great freeware program for creating online photo albums. It is sleek, easy to use, and does things the right way.
The only complaint I have is that it is not very customizeable. I like how in Facebook albums, clicking on the current photo takes you to the next photo, providing a quick way to skim through the pictures without having to find the "next" link. Web Album Generator has no option for this. But, since the output is just normal HTML, I can write a script to make changes to all of the HTML files.
Here's a Python script that will do the trick. If you haven't used Web Album Generator, you should give it a try. After exporting the album, specify the directory (strDirectory) and run the script. (You might want to make a backup copy first.)
# Designed for Web Album Generator 1.8.2 (
import os
import re

strDirectory = r"C:\outputdirectory"
astrFiles = os.listdir(strDirectory)

reNextPicture = re.compile('<a href="([^"]+.html)" title="Next Photograph">Next')
reEndlink = re.compile('(</div>)\s+(<p class=")')

def main():
  for strFilename in astrFiles:
    if strFilename.endswith("html"):
      f = open(st + '\\' + strFilename, 'r')
      strHtml = #Read entire file
      objmatch =, strHtml)
      if objmatch:
        filenext =
        strHtml = strHtml.replace('<div id="photograph">', '<div id="photograph"><a href="'+filenext + '">',1)
        strHtml = reEndlink.sub('</a> </div> <p class="',strHtml)

        fout = open(strDirectory + '\\' + strFilename, 'w')
        print "Written:" + strFilename