Ping All Search Engines

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def ping_all_search_engines(sitemap_url=None):
    """
    Pings the popular search engines, Google, Yahoo, ASK, and
    Windows Live, to let them know that you have updated your
    site's sitemap. Returns successfully pinged servers.
    """
    from django.contrib.sitemaps import ping_google
    SEARCH_ENGINE_PING_URLS = (
        ('google', 'http://www.google.com/webmasters/tools/ping'),
        ('yahoo', 'http://search.yahooapis.com/SiteExplorerService/V1/ping'),
        ('ask', 'http://submissions.ask.com/ping'),
        ('live', 'http://webmaster.live.com/ping.aspx'),
    )
    successfully_pinged = []
    for (site, url) in SEARCH_ENGINE_PING_URLS:
        try:
            ping_google(sitemap_url=sitemap_url, ping_url=url)
            pinged = True
        except:
            pinged = False
        if pinged:
            successfully_pinged.append(site)
    return successfully_pinged

More like this

  1. Middleware to detect visitors who arrived from a search engine by exogen 6 years, 1 month ago
  2. Partial OpenID provider implementation from idproxy.net by simon 5 years, 10 months ago
  3. Sphinx Search ORM by zeeg 6 years ago
  4. HTML/JS template filter to show localized dates/times by mback2k 4 years, 1 month ago
  5. Test Django against many Pythons and databases by jacobian 6 years, 2 months ago

Comments

(Forgotten your password?)