The easiest, and most effective way to ping Google is to add your site's RSS feed as a site index. They've accepted those in lieu of custom XML for over a year.
For an outside, non-code ping, you can write your post to
Ping-O-Matic's XML-RPC gateway, or use their website for the same.