File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed
Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,23 @@ jobs:
5151
5252 - name : Ping IndexNow
5353 run : |
54- for url in \
55- "https://csa-admin.org/" \
56- "https://csa-admin.org/acp/" \
57- "https://csa-admin.org/solawi/"
58- do
59- curl -s -o /dev/null -w "IndexNow %{url_effective} → HTTP %{http_code}\n" \
60- "https://api.indexnow.org/indexnow?url=${url}&key=8f940d3ccbab4035acab547df3432ac0"
61- done
54+ http_code=$(curl -s -o /tmp/indexnow-response.txt -w "%{http_code}" \
55+ -H "Content-Type: application/json; charset=utf-8" \
56+ -d '{
57+ "host":"csa-admin.org",
58+ "key":"8f940d3ccbab4035acab547df3432ac0",
59+ "keyLocation":"https://csa-admin.org/8f940d3ccbab4035acab547df3432ac0.txt",
60+ "urlList":[
61+ "https://csa-admin.org/",
62+ "https://csa-admin.org/acp/",
63+ "https://csa-admin.org/solawi/"
64+ ]
65+ }' \
66+ "https://api.indexnow.org/indexnow")
67+
68+ echo "IndexNow canonical URL submission → HTTP ${http_code}"
69+ cat /tmp/indexnow-response.txt
70+
71+ if [ "${http_code}" -lt 200 ] || [ "${http_code}" -ge 300 ]; then
72+ exit 1
73+ fi
You can’t perform that action at this time.
0 commit comments