I tested it on Livejournal and Dreamwidth, and it seems to work, so hooray. It mmmay work on other LJesque sites, but I don't have accounts on those, so...
NOTE: Always check to make sure you have the most recent version of the file.
If you have input on this, feel free to provide input. I'm very new to Python, so I'm sure I missed something.