Is anyone out there in TM land using Wordpress and Ultimate Tag Warrior? If so, I've managed to combine some of my mods and make the UTW tags accessible from TextMate. There's a whole bundle involved, and you have to replace your xmlrpc.php file (after backing it up, of course). It's working really smoothly on my end. If I type fetchtags and hit tab, it gets the entire database of tags, sorts it and returns a multi-select menu. When you finish picking tags it inserts a line in the header with a comma-separated list of your chosen tags.
It's got the functionality to save and modify new and existing tags.
I also got it working with my AutoTag mod, so that it can read your current post and suggest tags based on a fuzzy search of your database. I could easily add the Yahoo suggest if anyone was interested, but I've never liked the results I get anyway.
My biggest question is this, sorry it took me so long to get around to it...
After I've accepted an entire document as input, chosen tags and have a string ready to print, what's the most elegant way to make sure that string gets inserted in the blog post headers rather than at the end of the file?
On 1/10/2006, at 5:07, Brett Terpstra wrote:
[...] After I've accepted an entire document as input, chosen tags and have a string ready to print, what's the most elegant way to make sure that string gets inserted in the blog post headers rather than at the end of the file?
Assuming this is Ruby:
header = "Category: dummy\n" document.sub!(/^(?![A-Za-z0-9]+:)/, header)
That should insert the header below the last header line, or top of file if no headers.
For bonus points you might want to insert an additional blank line, when there were no preexisting headers.