I’ve been working all day on a perl script that will massage my “links of the day” postings in the same manner that I have been doing manually for some year(s). It fetches a post by ID#, de-bullets the del.icio.us links-of-the-day via painstaking regular expression transformations. It scrunches each link into a paragraph, and bolds my “title category”) (e.g. “ABUSE OF AUTHORITY:”, “TECHNOLOGY WAR:”, etc). It also sweeps these title categories up to create a posting title automatically (“LINKS: abuse of authority, religion, censorship”). It observes the del.icio.us tags used, and consults these against a table of “tag icon” images that I have (for example, the silhouette of an officer swinging a nightstick for abuse of authority stories), and automatically adds a related image next to those stories. Alignment alternates between right and left automatically.

It also assigns applicable WordPress tags automatically, based on the del.icio.us tags entered — with some special alias mapping. For example delicious’s “WarOnTerror” needs to become WordPress’s “The War On Terror“, because I chose to use a “the” on my blog) (and some sick things too, like if it is del.icio.us tagged “media” and “tv” and “shows” but not “cartoons” then it gets my wordpress “live-action shows” tag). Obviously, it only uses existing WordPress categories, rather than creating a bazillion new ones.

Suffice to say that now, instead of doing 10-15 minutes work, I just need to run the script with the 4 digit posting ID to have it fixed. Well, once I’m done. Right now, it simply re-writes the cleaned post to an old post that no one sees anymore ( https://clintjcl.wordpress.com/?p=5 ), because I didn’t want to destroy the original. I still have more to do on this tomorrow.
TODO/NOTE TO SELF: If 2 related images pop up for the same story, I need to decide which one is more important. I could accomplish this via numerical priority, or simply arranging my hash table in order of priority and aborting when I make my first match. (In that case, I would put more specific iconic images above less specific ones.) (May have to deliberately tag a story incorrectly to force this situation to happen.)

TODO/NOTE TO SELF: Suppress display of certain tags from the tag list automatically. For example, I del.icio.us tag cartoons as “media video TV shows cartoons”, but in this case all that really need to be on the wordpress blog is “cartoons”, the most specific one of the set. Generally, whenever a post is about politics, it has another tag with it, like censorship — so I don’t always need the politics tag either.

TODO/NOTE TO SELF: The final step in all this would be writing a separate script to check my RSS feed for posts titled “links for 2008-12-31” — those are the uncleaned ones — and then go and clean those automatically. I could even schedule it — though I wont.

Mood: liberated
Music: Circle Jerks – Coup D’etat