Skip to content

Commit

Permalink
Function to check sitemaps
Browse files Browse the repository at this point in the history
Checking if a string seem to be a sitemap or siteindex.
  • Loading branch information
Marcus Österberg committed Aug 22, 2017
1 parent dd65691 commit b13ae67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions helper.py
Expand Up @@ -145,11 +145,12 @@ def httpRequestGetContent(url):
pass


def isSitemap(content):
"""Check a string to see if it is a sitemap/siteindex
def is_sitemap(content):
"""Check a string to see if its content is a sitemap or siteindex.
Attributes: content
Attributes: content (string)
"""
if 'http://www.sitemaps.org/schemas/sitemap/' in content or '<sitemapindex' in content: return True

return False

Expand Down

0 comments on commit b13ae67

Please sign in to comment.