Here is a small piece of code in Python – Zope using MySQL as the database. This will help you build a Google News Sitemap in 2 minutes.
# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
response = request.RESPONSE
response.setHeader('Content-Type', 'text/xml')
print ''
print '
for item in context.sql.getNewsForToday():
print ‘
build_url = “http://www.yoursite.com/news/”+str(item.news_id)+”.html?google”
print ‘
print ‘
#date w3c format
print ‘
print ‘
print ‘
print ‘
print ”
return printed
2 responses so far ↓
1 David // Mar 22, 2008 at 11:24 am
I already have google sitemap , why a new news sitemap?
2 Prakash // Mar 22, 2008 at 11:28 am
If you are a news publisher or magazine publisher having a google news sitemap will help google to crawl pages faster
Leave a Comment