Over the last few week I’ve been blogging happily from TextMate and feeling quite pleased with myself. I even wrote a crude command from the blogging bundle to convert a set of selected words to technorati tags. Unfortunately I didn’t check it out properly and the links produced were broken. So this morning I fixed it and used textMate to retrive the posts fix the links and repost them, not noticing until I had finished that that set the date to todays. I’ve reordered them now, but it looks like I went mad blogging today.
This is my code, it is important to note I know nothing at all about shell scripting so just used google to figue out what to use:

echo  "<p class="ttags">"

tt="<a href="http://www.technorati.com/tag/thetag/" rel="tag" target="_blank">thetag</a>"

str=$TM_SELECTED_TEXT

for word in $str; do echo ${tt//thetag/$word}; done

echo "</p>"

Hopefully the next paragraph will show it works:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)

Before August 2014 I used disqus for comments, so this form shows up on older posts.

blog comments powered by Disqus