source: products/qPloneGoogleSitemaps/trunk/utils.py @ 458

Last change on this file since 458 was 458, checked in by fenix, 18 years ago

qPloneResolveUID import

File size: 519 bytes
RevLine 
[1]1from urllib2 import urlopen
2from urllib  import quote as urlquote
[458]3
[1]4from OFS.ObjectManager import BadRequestException
[458]5
6from Products.qPloneGoogleSitemaps.config import testing
7
8def ping_google(url, sitemap_id):
[1]9    """Ping sitemap to Google"""
[458]10    resurl = url + "/" + sitemap_id
11    sitemap_url = urlquote(resurl)
[1]12    g = urlopen('http://www.google.com/webmasters/sitemaps/ping?sitemap='+sitemap_url)
13    result = g.read()
14    g.close()
[458]15    if testing:
16        print "Pinged %s sitemap to google" % resurl
[1]17    return 0
Note: See TracBrowser for help on using the repository browser.