johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

delicious_related.py

I've written a rough draft of my first pyblosxom plugin. It seems to be working, basically. It replaces a variable in each entry with a list of tags and links to those tags from my del.icio.us account that it thinks might be relevant. Right now, the way it decides what is relevant is very primitive. It just grabs a list of tags I've used via the del.icio.us API, then compares that list with the words in the entry being processed. A tag is considered relevant if the tag word appears in the entry. A user option determines how many tags are displayed. If this limit is set to 5, for example, then the 5 tags that appeared the most in the entry are displayed.

I have a number ideas for improving it. Optimizing the code. I'm a Python beginner, and the code is sloppy and disorganized. My emphasis was on just getting it to work first, with the idea of going back and re-structuring things later. I will also try to make it smarter at determining which tags might be relevant, and add in some more options, like regexp patterns to make certain tags never display. I hope to add a mapping option so that users can create their own lines of relevance.

Tags: delicious, pyblosxom, python, script
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments