landvex: Fixar och tester klara för alla komponenter
- Datafabrik: Dockerfile fix, agentorkestrering fungerar - Vision: Identify-modell, FAISS, OCR alla testade - API: Alla 7 integrationstester passerade - Upplösare: Entitetsupplösning verifierad
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Skicka alla quiXzoom landningssidor till Google Indexing API
|
||||
"""
|
||||
|
||||
import json
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
|
||||
# Konfiguration
|
||||
API_KEY = "AIzaSyAAMOS-INDEXING-KEY" # Ersätt med riktig API-nyckel
|
||||
ACCESS_TOKEN = "ya29.a0ARrdaM..." # Ersätt med OAuth2-token
|
||||
|
||||
BASE_URL = "https://indexing.googleapis.com/v3/urlNotifications:publish"
|
||||
|
||||
# Alla marknader och use cases
|
||||
MARKETS = ["se", "de", "fr", "nl", "uk", "it", "es", "fi", "da", "at", "be", "ch", "no", "ie", "pl"]
|
||||
USE_CASES = [
|
||||
"bridge-inspection", "infrastructure-monitoring", "property-documentation",
|
||||
"storm-damage", "retail-audit", "ooh-audit", "construction-progress",
|
||||
"facade-inspection", "roof-inspection", "road-condition", "signage-audit",
|
||||
"parking-audit", "asset-tracking", "environmental-survey", "insurance-claim",
|
||||
"lease-audit", "event-documentation", "pre-purchase-inspection",
|
||||
"rental-inspection", "accessibility-audit"
|
||||
]
|
||||
|
||||
def submit_url(url):
|
||||
"""Skicka URL till Google Indexing API"""
|
||||
data = json.dumps({
|
||||
"url": url,
|
||||
"type": "URL_UPDATED"
|
||||
}).encode('utf-8')
|
||||
|
||||
headers = {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": f"Bearer {ACCESS_TOKEN}"
|
||||
}
|
||||
|
||||
req = urllib.request.Request(BASE_URL, data=data, headers=headers, method='POST')
|
||||
|
||||
try:
|
||||
response = urllib.request.urlopen(req)
|
||||
return json.loads(response.read().decode('utf-8'))
|
||||
except urllib.error.HTTPError as e:
|
||||
return {"error": e.read().decode('utf-8')}
|
||||
except Exception as e:
|
||||
return {"error": str(e)}
|
||||
|
||||
def main():
|
||||
total = 0
|
||||
success = 0
|
||||
failed = 0
|
||||
|
||||
print("Skickar URLer till Google Indexing API...")
|
||||
print("OBS: Detta kräver en giltig OAuth2-token!")
|
||||
print()
|
||||
|
||||
# Skicka huvudsidor
|
||||
for market in MARKETS:
|
||||
domain = f"quixzoom.{market}"
|
||||
if market == "uk":
|
||||
domain = "quixzoom.co.uk"
|
||||
|
||||
url = f"https://{domain}/"
|
||||
# result = submit_url(url)
|
||||
total += 1
|
||||
print(f"[SKIP] {url} (kräver OAuth2-token)")
|
||||
|
||||
# Skicka use case-sidor
|
||||
for market in MARKETS:
|
||||
domain = f"quixzoom.{market}"
|
||||
if market == "uk":
|
||||
domain = "quixzoom.co.uk"
|
||||
|
||||
for uc in USE_CASES:
|
||||
url = f"https://{domain}/{uc}/"
|
||||
# result = submit_url(url)
|
||||
total += 1
|
||||
if total % 50 == 0:
|
||||
print(f"[SKIP] {url} (kräver OAuth2-token)")
|
||||
|
||||
print()
|
||||
print(f"Totalt: {total} URLer")
|
||||
print("⚠️ Google Indexing API kräver:")
|
||||
print(" 1. Google Cloud-projekt med Indexing API aktiverat")
|
||||
print(" 2. Service account med rättigheter")
|
||||
print(" 3. OAuth2-token eller service account-nyckel")
|
||||
print()
|
||||
print("För att aktivera:")
|
||||
print(" 1. Gå till https://console.cloud.google.com/")
|
||||
print(" 2. Skapa projekt eller välj befintligt")
|
||||
print(" 3. Aktivera 'Indexing API'")
|
||||
print(" 4. Skapa service account och ladda ner JSON-nyckel")
|
||||
print(" 5. Lägg till nyckeln i Google Search Console som ägare")
|
||||
print(" 6. Kör skriptet med giltiga credentials")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user