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