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.
Several weeks ago, as it became evident that node 600,000 would be coming along shortly, I considered trying to "grab it" as it became available.
On probably 5 or 6 occasions I was tempted to craft an Obfuscated code post, but each time surrendered the thought, due to the stress it might take, both to predict the approximate day, and then to have to watch patiently while #600000 came closer and closer. There was also a fair chance it might happen at night (my time), and I wasn't about to stay awake for it.
In all honesty, I never even considered using a script to do it, even for the short term of the last few minutes. The idea of not doing it "by hand" would have left too much to chance; I figured the best shot would have been to wait until #600000 was next in line, with my post already previewed and ready to submit next.
On Wednesday we were snowed in, with the first major blizzard of the year (for New England). Shortly after I wandered into the Monastery, I noticed that it was down to the last 50 nodes or so, and again the urge was rekindled to claim the node for myself.
With renewed resolve, I began an obfuscation that would hide a message amidst the code, printing first "welcome to node ...", and then turn into a big, colorful "600,000!". But as I worked on the obfuscation (checking every few minutes on the number of the newest node), it became clearer and clearer there wasn't going to be enough time!
So eventually I gave up the idea of doing an obfuscation, and focused my energy on a Perl Poetry submission instead.
My haiku finished, I went back to Newest Nodes, and was startled to see node #599999 already posted. Hastily, I went to hit the "create" button on my post and ... disaster! A title hadn't been chosen, so the "create" button was not even visible yet! Even after frantically adding the title the post still was not accepted, because the chosen title was one word, and the two-word minimum was brutally enforced.
Although it was no more than 15 or 20 seconds, it seemed like an eternity as I struggled to submit the post as rapidly as I could. Fully expecting to miss the mark, I was finally rewarded with the "create" button, and clicked on it, with my heart racing ... success! Frankly, had another monk been scheming to achieve the same goal, my attempts could easily have been in vain.
PS. I see that node #600296 was just submitted, so I'll wait and try to make this one a nice, round #600300. ;-D