Problem with GoogleSitemap Script

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with GoogleSitemap Script

Robert Pfau
Hi
I tried to use the generateSitemap.php script

It is working, it just gives out the wrong timestamp
According to Google a timestamp should look like this (ISO8601)
<lastmod>2004-10-26T08:56:39+00:00</lastmod>

But it looks like this
<lastmod>1135341616</lastmod>
I tried it in an 1.5.4 and in a cvs environment.
Both times the same result. An obviously correct sitemap with
wrong timestamps.
i used this cvs-version
cvs -z3 -d:pserver:[hidden email]:/cvsroot/wikipedia
checkout -P phase3

what could it be ? anyone got a similar effect ?

thanks in advance
.robert
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Problem with GoogleSitemap Script

Adrian Overbury
That looks like a Unix timestamp, commonly used for simple time
differentials in PHP.  It's the current date and time as expressed in
the number of seconds since the Unix Epoch (Midnight, January 1st,
1970).  I'm not familiar with the script itself, but it looks to me as
though whichever part of the script is generating the timestamp (with
the date() command, probably) isn't running it through an interpretation
string to turn out the correct format of date.

Adrian

Robert Pfau wrote:

> Hi
> I tried to use the generateSitemap.php script
>
> It is working, it just gives out the wrong timestamp
> According to Google a timestamp should look like this (ISO8601)
> <lastmod>2004-10-26T08:56:39+00:00</lastmod>
>
> But it looks like this
> <lastmod>1135341616</lastmod>
> I tried it in an 1.5.4 and in a cvs environment.
> Both times the same result. An obviously correct sitemap with
> wrong timestamps.
> i used this cvs-version
> cvs -z3 -d:pserver:[hidden email]:/cvsroot/wikipedia
> checkout -P phase3
>
> what could it be ? anyone got a similar effect ?
>
> thanks in advance
> .robert
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Problem with GoogleSitemap Script

Robert Pfau
thanks, now i know why it is happening.
i use php4.3 but the iso8601-argument only exists since php5

so this is my fix:
line ~ 400:
function fileEntry( $url, $date, $priority ) {
        return
            "\t<url>\n" .
            "\t\t<loc>$url</loc>\n" .
            "\t\t<lastmod>".date("Y-m-d",$date)."</lastmod>\n" .
            "\t\t<priority>$priority</priority>\n" .
            "\t</url>\n";
    }

thats it :) ok, no exact time, but it works :)

greetings
.robert

>That looks like a Unix timestamp, commonly used for simple time
>differentials in PHP.  It's the current date and time as expressed in
>the number of seconds since the Unix Epoch (Midnight, January 1st,
>1970).  I'm not familiar with the script itself, but it looks to me as
>though whichever part of the script is generating the timestamp (with
>the date() command, probably) isn't running it through an interpretation
>string to turn out the correct format of date.
>
>Adrian
>
>Robert Pfau wrote:
>  
>
>>Hi
>>I tried to use the generateSitemap.php script
>>
>>It is working, it just gives out the wrong timestamp
>>According to Google a timestamp should look like this (ISO8601)
>><lastmod>2004-10-26T08:56:39+00:00</lastmod>
>>
>>But it looks like this
>><lastmod>1135341616</lastmod>
>>I tried it in an 1.5.4 and in a cvs environment.
>>Both times the same result. An obviously correct sitemap with
>>wrong timestamps.
>>i used this cvs-version
>>cvs -z3 -d:pserver:[hidden email]:/cvsroot/wikipedia
>>checkout -P phase3
>>
>>what could it be ? anyone got a similar effect ?
>>
>>thanks in advance
>>.robert
>>_______________________________________________
>>MediaWiki-l mailing list
>>[hidden email]
>>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>>
>>    
>>
>_______________________________________________
>MediaWiki-l mailing list
>[hidden email]
>http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
>  
>

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l