Sitemap Plugin (was Google Sitemap Plugin)
Sitemap Plugin (was Google Sitemap Plugin)
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
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.
I have just done the same...
But much simpler, as I don't see the requirement for having each and every link.
I have noticed with my plugin that the plugin does not register the entry I am saving (as it is not in the database yet).
I haven't tried yours, but have you checked ?
Mike
I have noticed with my plugin that the plugin does not register the entry I am saving (as it is not in the database yet).
I haven't tried yours, but have you checked ?
Mike
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: I have just done the same...
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.
For example:
needs to be changed to
thanks a lot for your contribution!
Regards,
Garvin
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.
For example:
Code: Select all
$url = serendipity_rewriteURL(PATH_CATEGORIES . '/' . serendipity_makePermalink(PERM_CATEGORIES, array('id' => $category['id'], 'title' => $category['name'])));
Code: Select all
$url = serendipity_makePermalink(PERM_CATEGORIES, array('id' => $category['id'], 'title' => $category['name']), 'category');
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/
# 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/
Re: I have just done the same...
Googles Sitemap-Generator adds every link you have in your logs, somreys wrote:But much simpler, as I don't see the requirement for having each and every link.
IMO the sitemap should contain every link the Googlebot is able to crawl.
As Garvin said: it generates a new sitemap on every "save" and "publish"-hook. But the queries only fetch published entries.mreys wrote:I have noticed with my plugin that the plugin does not register the entry I am saving (as it is not in the database yet).
I haven't tried yours, but have you checked ?
That would make maintaining easier for both of us. :)garvinhicking wrote:Do you have or want a CVS account to maintain your plugin?
system() call not reliable! that caused the hickup
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?)
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.
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.
-
- Regular
- Posts: 146
- Joined: Tue Jul 12, 2005 9:12 pm
- Location: Ottawa, Canada
- Contact:
-
- Regular
- Posts: 146
- Joined: Tue Jul 12, 2005 9:12 pm
- Location: Ottawa, Canada
- Contact:
-
- Regular
- Posts: 146
- Joined: Tue Jul 12, 2005 9:12 pm
- Location: Ottawa, Canada
- Contact:
If you want to check the sitemap generated is actually working you should go here - http://www.google.com/webmasters/sitemaps/login
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.
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.
gw
-
- Regular
- Posts: 146
- Joined: Tue Jul 12, 2005 9:12 pm
- Location: Ottawa, Canada
- Contact:
Following my own advice ... Google read my sitemap.gz file successfully!
But it's important that you include the name of the sitemap at the end of the URL you enter.
So enter http://www.yoursitename.com/blog/sitemap.gz
not http://www.yoursitename.com/blog/
But it's important that you include the name of the sitemap at the end of the URL you enter.
So enter http://www.yoursitename.com/blog/sitemap.gz
not http://www.yoursitename.com/blog/
gw
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):
Any suggestions?
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.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.
Any suggestions?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
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/
# 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:
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.Serendipity is now saving your entry, creating trackbacks and performing possible XML-RPC calls. This may take a while..