Continued with the migration of the old Guestbook
Ok, with vim and a lot of search and replace (:%s/…/…/gc) I successfully transferred the whole guestbook into xml-format. BUT …
the entry-tags need an unique id-attribute… aaand the entry date needs to be transformed into unix-timestamp 
a little perl-script (perl is another of my little helpers here) helps me with the id-thing and after a little research the perl-module Time::Local helps with the timestamp out of the parts of the date-time with a nice regular-expression…
Now… a php-script helps to convert the xml-information into SQL… and filter out some unwanted entries (guestbook-spam) and multiple entries (probably because of clicking the submit-button more than once) reduced to one…
and after about the 30th or 40th try always still with a little tweaking of the perl or php-script or even some straightening of the xml-file all the entries where correctly in the Database.
More about this here in this blog:
Post a comment