nameandnature: Giles from Buffy (I'm a scientist)
[personal profile] nameandnature
As promised, the link blog stuff is now working. It's pulling links and descriptions from my Delicious bookmarks and posting them to LJ in batches of 10 or more, or when there's stuff to be posted and nothing's been posted for 4 days. Let me know if it becomes annoying.

Here comes the science

It turns out there's a PHP script called Delicious Glue to do this, but that would involve using PHP, so no (gateway drug: next thing you know, you'll be using Perl). It looks like that script also doesn't cope with the brave new world of Unicode terribly well, doesn't tag the LJ post using the tags from Delicious, and doesn't support the elaborate posting scheme described in the previous paragraph. Also, it wasn't invented here.

So I did it in Python. Mark Pilgrim's excellent Universal Feed Parser module does much of the heavy lifting. Posting to LJ using XML RPC turns out to be surprisingly easy using the built-in xmlrpclib. Most of the faff comes in getting it to persist state between runs of the script, which I'm doing using pickle. Here's the code: you'd need to be a programmer to adapt it for your own use, but if you are, it shouldn't be hard. I'll probably run it daily using cron.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

nameandnature: Giles from Buffy (Default)
nameandnature

February 2025

S M T W T F S
      1
23 45678
910 1112131415
1617 1819202122
2324252627 28 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 4th, 2025 03:54 pm
Powered by Dreamwidth Studios