|
import requests |
|
import json |
|
|
|
|
|
HOST = "ttopm.github.io" |
|
|
|
|
|
KEY = "e7c342fe19a548a3c3e7fc189c9517d3a4b14c94db5c2a661e91efc209fa5c73" |
|
|
|
|
|
KEY_LOCATION = f"https://{HOST}/be-core-bridge/indexnow.txt" |
|
|
|
|
|
NEW_UPDATE_URL = "https://ttopm.github.io/be-core-bridge/README.md" |
|
|
|
|
|
payload = { |
|
"host": HOST, |
|
"key": KEY, |
|
"keyLocation": KEY_LOCATION, |
|
"urlList": [NEW_UPDATE_URL] |
|
} |
|
|
|
|
|
response = requests.post( |
|
"https://api.indexnow.org/indexnow", |
|
headers={"Content-Type": "application/json"}, |
|
data=json.dumps(payload) |
|
) |
|
|
|
|
|
if response.status_code == 200: |
|
print("✅ Update successfully submitted to IndexNow.") |
|
else: |
|
print(f"❌ Failed to submit update. Status: {response.status_code}") |
|
print("Response:", response.text) |
|
|