Meta Tag generator - how it works
Preperation
-
The list of words to ignore is loaded into memory.
-
For each .htm file in the selected directory.
Scanning
-
The contents of the entire .htm file is read into memory and shifted into lower case.
-
The text is searched for the <meta name="description" tag and the "contents=" values are extracted
-
It is then searched for the <title> tag and its' contents are stored.
-
All blocks of data starting with < and ending with > (i.e. All HTML tags) are replaced with spaces.
-
All Javascript text blocks are replaced with spaces.
-
Any special character definitions (words starting with '#') are replaced with spaces.
-
All punctuation is replaced with spaces.
-
The remaining data is scanned and any multiple spaces are reduced to a single space.
-
The data is now parsed into an array, using a single space as the end of word delimiter.
-
Each word of the array is compared to the list of words in the ignore list and if a match is found, then the word in the array is replaced with a space.
-
Each word in the array is then compared to each following word in the array and if the words are duplicated, the later word is replaced with spaces.
-
The array has all of the space entries removed.
-
The array is rebuilt into the meta tag string using a single comma to seperate the words.
-
The meta tag string is inspected and leading commas are removed as are any double commas.
-
If the option to create a search array has been selected, the Description, URL, Title and meta tag string are written to the file.
-
If the option to write to a meta tag text file is selected, a new file is created (in the selected directory) with the name of of the original htm page with '.meta.text' appended to it and the line
<meta name="keywords" content=" & meta tag string & "> is written to the file and then the file is closed. -
If the option to update the htm file directly is selected, then the original htm file is renamed to 'temp.html', a new file is opend with the original file name, the old file is copied until <meta name="keywords" is found (or </head> is found). The new meta tag string is written. The old file is searched for the end of the old meta tag (if found) and then the remainder of the old file is copied out.
Download.
To download the installation set, click here. To download the EXE only (you will need to have the VB6 SP5 runtimes all ready installed) click here. If you have VB6 as a development language the to download the Visual Basic 6 source code, click here.