Posting shared items from Google Reader to Delicious

I'd been meaning for a while to write a script that would take a feed of 'shared' items from Google Reader (shared using Byline, in this case) and post them to Delicious. Here's some scrappy code that does that (including resolving URLs from whatever was in the feed, to avoid duplicates, and using 'replace=no' so as not to overwrite existing bookmarks).

The main problem is that the 'date shared' doesn't appear in the Google Reader feed, so items are bookmarked at the date the original item was published, which isn't ideal.