Last change
on this file since 1061 was
458,
checked in by fenix, 18 years ago
|
qPloneResolveUID import
|
File size:
519 bytes
|
Line | |
---|
1 | from urllib2 import urlopen |
---|
2 | from urllib import quote as urlquote |
---|
3 | |
---|
4 | from OFS.ObjectManager import BadRequestException |
---|
5 | |
---|
6 | from Products.qPloneGoogleSitemaps.config import testing |
---|
7 | |
---|
8 | def 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.