IndexNow
cohenaj194 opened this issue · 1 comments
cohenaj194 commented
need to do 100 of these a day
https://www.bing.com/webmasters/url-submission-api#APIs
https://www.bing.com/webmasters/submiturl?siteUrl=https://saddlebagexchange.com
curl -X POST "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey=$BINGAPIKEY" \
-H "Content-Type: application/json; charset=utf-8" \
-d '{
"siteUrl": "https://saddlebagexchange.com/",
"urlList": [
"https://saddlebagexchange.com/wow/item-data/25",
"https://saddlebagexchange.com/wow/item-data/35",
"https://saddlebagexchange.com/wow/item-data/36",
....
"https://saddlebagexchange.com/wow/item-data/167",
"https://saddlebagexchange.com/wow/item-data/168",
"https://saddlebagexchange.com/wow/item-data/169",
"https://saddlebagexchange.com/wow/item-data/170",
"https://saddlebagexchange.com/wow/item-data/171"
]
}'
cohenaj194 commented
automated
#!/bin/bash
# Define the API key and the maximum number of URLs to submit
MIN_ID=171
MAX_URLS=$((MIN_ID + 200)) # Adjust the number of URLs as needed
# Download the sitemap and extract URLs containing 'wow/item-data'
URLS=$(curl -s https://saddlebagexchange.com/sitemap.xml | grep 'https://saddlebagexchange.com/wow/item-data/' | head -n $MAX_URLS | sed 's/<[^>]*>//g')
# Prepare the JSON payload
total_urls=0
JSON_PAYLOAD="{\"siteUrl\": \"https://saddlebagexchange.com/\", \"urlList\": ["
for URL in $URLS; do
id=${URL##*/}
if [[ $id -gt $MIN_ID ]]; then
JSON_PAYLOAD+="\"$URL\","
total_urls=$((total_urls + 1))
if [[ $total_urls -eq 100 ]]; then
break
fi
fi
done
# Remove the last comma and close the array and object
JSON_PAYLOAD="${JSON_PAYLOAD%,}]"
echo $JSON_PAYLOAD
# # Make the cURL POST request
# curl -X POST "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlbatch?apikey=$BINGAPIKEY" \
# -H "Content-Type: application/json; charset=utf-8" \
# -d "$JSON_PAYLOAD"