There's no need for any code. Perlmonks nodes are posted infrequently enough (say once every five or ten minutes) that you can watch Newest Nodes by hand and have a high chance to be able to catch the right time to post.
Update: don't take this as devaluing the poetry. I think even like this it's a very clever hack.