I wrote a plugin to create a sitemap for the Google-Crawler. It's far from perfect, but I works for me and does everything I expect from it.
Download it via spartacus or from CVS and please report all problems with the plugin. Comments are welcome too.
The queries are tested with mysql and some (but not all) with postgres and sqlite. If they work, please report too.
Developers: Feel free to use this for every purpose you like.
--
EDIT1: Linked to CVS
EDIT2: Updated download-advise
Last edited by Boris on Fri Nov 17, 2006 3:51 pm, edited 3 times in total.
This plugin should work with every saved entry; of course it will not update the sitemap if a draft entry is saved only.
On a sidenote, I've just committed the plugin as event_google_sitemap, thank you Boris! Do you have or want a CVS account to maintain your plugin? Your code looks well thought of, so I'd love if you can maintain your script there. Like for example it is not yet compatible with Serendipity's 0.9 changes in the Permalink generation.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
I used the system call the gzip my file...
Problem is, if gzipped file already exists, it is not overwritten. Because of the way I was testing I thought that the file did not get updated!
backend_publish was the right way of doing things! (entry update should then work as well, as soon as it gets tested).
Forgive myself for looking immediately at the serendipity code, not at the basic system() code.
I'm not a php programmer, and I was relying on php too much. Anyway, my code was not portable for windows as the gzip command probably doesn't exist. Just found out (thanks to the code above) that php contains a gzip functionality (if properly compiled?)
Um, I'm new to Google Sitemaps. Do I need to go to Google and generate one before using this plug-in, or will this plug-in do that?
Where it says " URL for Google pingback (%s is replaced with sitemap URL)", does that mean I need to replace it with something, or it will do that automatically? I have no idea what to replace %s with, because I don't already have a sitemap.
I guess I just need really simple instructions on this, sorry.
Log in using either your gmail email account or your google account id (for adsense). You'll be presented with a page where you can manually ask google to come and check out your sitemap.
After entering your root URL, it might take several hours before you are indexed. When you return you'll find the result and hopefull all is well.
This should take away the "faith" aspect of this wonderful plugin and substitute "living proof" that it works.
This thing works great on one of my S9 sites. But on the other, it just won't generate the sitemap file. Today I finally got an error message (instead of it just hanging up in the "saving your entry" stage):
Warning: fopen(/home/bluemus/public_html//sitemap.gz): failed to open stream: Permission denied in /home/bluemus/public_html/plugins/serendipity_event_google_sitemap/serendipity_event_google_sitemap.php on line 313
Could not open the outfile for writing.
I did see that my host had changed permissions on the main directory (where S9 sits) so I changed them back to 755. But it still isn't creating that sitemap. I also got 1.4 of this plug in from CVS, and that didn't help either.
This definitely sounded like a permission thing! Do you still get the same error? Please check the permissions, if the host maybe changed it back?
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
The permissions setting on public_html (where S9 sits) is still 755, as I set it yesterday. I just published a new entry, and it did what it's been doing ever since I installed the plug-in. It sits on this page:
Serendipity is now saving your entry, creating trackbacks and performing possible XML-RPC calls. This may take a while..
indefinitely. It never gives me the list of URL's it successfully pinged, nor does it report updating the sitemap. The entry is published successfully, but the backend page just hangs up at that point.