Skip to content

Commit

Permalink
Create util_submit_sitemap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvianen committed Aug 8, 2024
1 parent c1cba27 commit 82dc137
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/swing-sitemap/utils/util_submit_sitemap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import requests

def submit_sitemap():
sitemap_url = "http://www.example.com/sitemap.xml" # Replace with your sitemap URL
google_url = f"http://www.google.com/ping?sitemap={sitemap_url}"
bing_url = f"http://www.bing.com/ping?sitemap={sitemap_url}"

try:
requests.get(google_url)
requests.get(bing_url)
# You can add logging or notification here
except requests.exceptions.RequestException as e:
# Handle exceptions, possibly log them or send notifications

0 comments on commit 82dc137

Please sign in to comment.