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