Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. # OK ash so here is a 'template' so to speak oh a file that you can play with.
  2.  
  3. sitemap = ['www.google.com', 'www.apple.com', 'www.yahoo.com', 'www.gosijsogspdogjsibgisug.com']
  4.  
  5. # Any line with a hash in front is a comment so it won't actually do anything btw, so there is your list of urls
  6.  
  7. def get_urls_from_sitemap(sitemap):
  8.     # This is a blank function, eventually will need to contain code to extract a list of strings from a sitemap.xml
  9.     # For we'll just return whatever is passed in
  10.     return urls
  11.  
  12. def check_url(url):
  13.     #This is a blank function that eventually will need to check the url and return whether it's ok or not
  14.     # For now I'll return True, even if url is bad
  15.     return True
  16.  
  17.  
  18. # Program code goes below
  19.  
  20. urls = get_urls_from_sitemap(sitemap)
  21. for url in urls:
  22.     # This is where we'd need to check each url
  23.     # We're going to set a variable called 'is_url_ok' to the result of the 'check_url()' function defined above, it will always be true until code is written
  24.     is_url_ok = check_url(url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement