113 lines
3.8 KiB
Python
113 lines
3.8 KiB
Python
|
|
"""Submit new blog URLs to IndexNow (Bing, Yandex, Seznam)"""
|
||
|
|
import urllib.request
|
||
|
|
import json
|
||
|
|
import os
|
||
|
|
import sys
|
||
|
|
|
||
|
|
SITE = "https://blog.quant-view.xyz"
|
||
|
|
KEY = "72aa77b68704abcfada4020ba81f7c5a"
|
||
|
|
|
||
|
|
# New pages from the 54 variant generator
|
||
|
|
new_pages = [
|
||
|
|
# Formula pages (10)
|
||
|
|
"tools/position-size-formula.html",
|
||
|
|
"tools/pip-value-formula.html",
|
||
|
|
"tools/kelly-criterion-formula.html",
|
||
|
|
"tools/atr-formula.html",
|
||
|
|
"tools/fibonacci-retracement-formula.html",
|
||
|
|
"tools/drawdown-formula.html",
|
||
|
|
"tools/margin-formula.html",
|
||
|
|
"tools/risk-reward-formula.html",
|
||
|
|
"tools/compound-interest-formula.html",
|
||
|
|
"tools/profit-factor-formula.html",
|
||
|
|
# Gold pages (6)
|
||
|
|
"tools/gold-atr-calculator.html",
|
||
|
|
"tools/gold-margin-calculator.html",
|
||
|
|
"tools/gold-drawdown-calculator.html",
|
||
|
|
"tools/xauusd-trading-guide.html",
|
||
|
|
"tools/gold-lot-size-calculator.html",
|
||
|
|
"tools/gold-spread-calculator.html",
|
||
|
|
# Forex pages (5)
|
||
|
|
"tools/forex-position-size-calculator.html",
|
||
|
|
"tools/forex-pip-calculator.html",
|
||
|
|
"tools/forex-margin-calculator.html",
|
||
|
|
"tools/forex-risk-calculator.html",
|
||
|
|
"tools/forex-lot-size-calculator.html",
|
||
|
|
# Forex pair guides (3)
|
||
|
|
"tools/eurusd-trading-guide.html",
|
||
|
|
"tools/gbpusd-trading-guide.html",
|
||
|
|
"tools/usdjpy-trading-guide.html",
|
||
|
|
# Crypto pages (5)
|
||
|
|
"tools/btc-position-size-calculator.html",
|
||
|
|
"tools/crypto-pip-calculator.html",
|
||
|
|
"tools/btc-margin-calculator.html",
|
||
|
|
"tools/eth-position-size-calculator.html",
|
||
|
|
"tools/crypto-risk-calculator.html",
|
||
|
|
# Pip variants (9)
|
||
|
|
"tools/pip-calculator-eurgbp.html",
|
||
|
|
"tools/pip-calculator-usdchf.html",
|
||
|
|
"tools/pip-calculator-solusd.html",
|
||
|
|
"tools/pip-calculator-dogeusd.html",
|
||
|
|
"tools/pip-calculator-adausd.html",
|
||
|
|
"tools/pip-calculator-bnbusd.html",
|
||
|
|
"tools/pip-calculator-dax40.html",
|
||
|
|
"tools/pip-calculator-sp500.html",
|
||
|
|
"tools/pip-calculator-ukoil.html",
|
||
|
|
# Index pages (4)
|
||
|
|
"tools/sp500-position-size-calculator.html",
|
||
|
|
"tools/nas100-position-size-calculator.html",
|
||
|
|
"tools/dax40-position-size-calculator.html",
|
||
|
|
"tools/index-margin-calculator.html",
|
||
|
|
# Educational (6)
|
||
|
|
"tools/risk-management-guide.html",
|
||
|
|
"tools/how-to-calculate-pip-value.html",
|
||
|
|
"tools/how-to-use-atr-for-stop-loss.html",
|
||
|
|
"tools/kelly-criterion-explained.html",
|
||
|
|
"tools/drawdown-recovery-guide.html",
|
||
|
|
"tools/margin-call-prevention.html",
|
||
|
|
# Comparison (3)
|
||
|
|
"tools/tradingview-vs-mt5.html",
|
||
|
|
"tools/ctrader-vs-mt5.html",
|
||
|
|
"tools/best-free-trading-tools.html",
|
||
|
|
# Account size variants (3)
|
||
|
|
"tools/position-size-calculator-100000-dollar-account.html",
|
||
|
|
"tools/position-size-calculator-20000-dollar-account.html",
|
||
|
|
"tools/position-size-calculator-3000-dollar-account.html",
|
||
|
|
# New articles
|
||
|
|
"position-size-calculator-guide.html",
|
||
|
|
"gold-trading-2026-guide.html",
|
||
|
|
"ssh-tunnel-deployment-china.html",
|
||
|
|
"github-seo-trading-tools.html",
|
||
|
|
"gold-pip-value-calculator-wrong.html",
|
||
|
|
# Sitemap
|
||
|
|
"sitemap.xml",
|
||
|
|
]
|
||
|
|
|
||
|
|
urls = [f"{SITE}/{p}" for p in new_pages]
|
||
|
|
print(f"Submitting {len(urls)} URLs to IndexNow...")
|
||
|
|
|
||
|
|
payload = json.dumps({
|
||
|
|
"host": "blog.quant-view.xyz",
|
||
|
|
"key": KEY,
|
||
|
|
"keyLocation": f"{SITE}/{KEY}.txt",
|
||
|
|
"urlList": urls
|
||
|
|
}).encode("utf-8")
|
||
|
|
|
||
|
|
engines = [
|
||
|
|
("Bing", "https://www.bing.com/indexnow"),
|
||
|
|
("Yandex", "https://yandex.com/indexnow"),
|
||
|
|
("Seznam", "https://search.seznam.cz/indexnow"),
|
||
|
|
]
|
||
|
|
|
||
|
|
for name, endpoint in engines:
|
||
|
|
try:
|
||
|
|
req = urllib.request.Request(endpoint, data=payload, headers={"Content-Type": "application/json"})
|
||
|
|
resp = urllib.request.urlopen(req, timeout=30)
|
||
|
|
print(f" {name}: HTTP {resp.status}")
|
||
|
|
except urllib.error.HTTPError as e:
|
||
|
|
print(f" {name}: HTTP {e.code} ({e.reason})")
|
||
|
|
except Exception as e:
|
||
|
|
print(f" {name}: Error - {e}")
|
||
|
|
|
||
|
|
print("Done!")
|