Last change
on this file was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
File size:
620 bytes
|
Rev | Line | |
---|
[1] | 1 | ## Script (Python) "ping_googlesitemaps.cpy" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters= |
---|
| 8 | ##title=Ping information to Google |
---|
| 9 | ## |
---|
| 10 | |
---|
| 11 | from Products.CMFCore.utils import getToolByName |
---|
| 12 | from Products.qPloneGoogleSitemaps.utils import ping_google |
---|
| 13 | |
---|
| 14 | url = getToolByName(context, 'portal_url')() |
---|
| 15 | |
---|
| 16 | portal_msg = "Google pinged. It will review your sitemap as soon as it will be able to." |
---|
| 17 | |
---|
| 18 | try: |
---|
| 19 | ping_google(url) |
---|
| 20 | except: |
---|
| 21 | portal_msg = "Cannot contact Google. Try again in a while." |
---|
| 22 | |
---|
| 23 | return state.set(portal_status_message = portal_msg) |
---|
Note: See
TracBrowser
for help on using the repository browser.