PDA

View Full Version : Google Sitemap set up


JAD
07-02-09, 15:28
Being new to this (Installation of SW Client Software)I'm in the process of setting up Google search spiders etc through their Webmaster site. It requests that I send them a "Sitemap". Has anyone done this already and is there a sitemap generator somewhere in the big wide yonder that I could use.
Regards JAD.

Amoochi
08-02-09, 15:14
If there has been such things done, nobody has bothered to share it with anyone else.

I'd love someone to share a Google sitemap generator that they'd made for Shop Window, i'm sure it would be beneficial to all of us.

JAD
08-02-09, 16:15
The stupid thing is I tried to use one of these online SiteMap creators and left it doing it's thing! I returned 30min later and found it had used up all my Quota for the day. hence my site is down until 5.00pm "I Hope". It had around 219,000 entries... It took 30min to process around 5,000 of the 219,000, so I stopped it...but the damage had been done. It checks the site first and came up with the 219,000. So I assume it spiders every page during the intitial checks.
So message is "don't use these online SiteMap generator sites unless you limit the pages it looks at".
regards JAD.

Andy
09-02-09, 16:12
When a page is accessed, log it's URL and time in a database.

Create a php script that accesses this DB table and outputs the logged URLs and times.


$outPut = "<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">";

"foreach" url in the DB:

$outPut .= '<url>
<loc>'.trim($linkUrl).'</loc>
<lastmod>'.date("Y-m-d", $linkDate).'</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>';
finish off the urlset:

$outPut .= "\n</urlset>";
you need to get php to output as XML, so use:

header("Content-type: application/xml");
Now kick it all out:
echo $outPut;


simples :D

IntroSites
09-02-09, 18:06
and dont forget to have the page url deleted from the DB when the product is no longer available, check the return for a missing productid

JAD
09-02-09, 18:12
Thanks for the idea Andy, I'm in the process of reading through my "PHP 5 In Easy Steps" book so your code and suggestion is a great way to get to know how it all comes together. Many thanks
JAD
:)

amcho
10-02-09, 15:43
IntroSites Search Spy should be easy to amend to do the
"log each page accessed bit"
you may need to sort the results..

Cool bit of code from both of you - thanks....