From 8b15613109a3687c4d148c8f9e5e5bfd6ca09ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 11 Dec 2024 12:43:44 +0100 Subject: [PATCH] Include the Google parameter ID in the UI for parameter that could be confusing otherwise --- tests/test_serp.py | 8 ++++---- zyte_spider_templates/spiders/serp.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_serp.py b/tests/test_serp.py index 9ca50c3..edb1f93 100644 --- a/tests/test_serp.py +++ b/tests/test_serp.py @@ -361,7 +361,7 @@ def test_metadata(): } for code in sorted(GoogleGl) }, - "title": "User Country", + "title": "User Country (gl)", "enum": list( sorted(GOOGLE_GL_OPTIONS, key=GOOGLE_GL_OPTIONS.__getitem__) ), @@ -377,7 +377,7 @@ def test_metadata(): "particular countries. See " "https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list#body.QUERY_PARAMETERS.cr" ), - "title": "Content Countries", + "title": "Content Countries (cr)", }, "geolocation": { "anyOf": [ @@ -414,7 +414,7 @@ def test_metadata(): } for code in sorted(GoogleHl) }, - "title": "User Language", + "title": "User Language (hl)", "enum": list( sorted(GOOGLE_HL_OPTIONS, key=GOOGLE_HL_OPTIONS.__getitem__) ), @@ -430,7 +430,7 @@ def test_metadata(): "specified languages. See " "https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list#body.QUERY_PARAMETERS.lr" ), - "title": "Content Languages", + "title": "Content Languages (lr)", }, }, "required": ["search_queries"], diff --git a/zyte_spider_templates/spiders/serp.py b/zyte_spider_templates/spiders/serp.py index 6490a81..b742bac 100644 --- a/zyte_spider_templates/spiders/serp.py +++ b/zyte_spider_templates/spiders/serp.py @@ -27,7 +27,7 @@ class GoogleCrParam(BaseModel): cr: Optional[str] = Field( - title="Content Countries", + title="Content Countries (cr)", description=( "Restricts search results to documents originating in " "particular countries. See " @@ -39,7 +39,7 @@ class GoogleCrParam(BaseModel): class GoogleGlParam(BaseModel): gl: Optional[GoogleGl] = Field( - title="User Country", + title="User Country (gl)", description=( "Boosts results relevant to this country. See " "https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list#body.QUERY_PARAMETERS.gl" @@ -58,7 +58,7 @@ class GoogleGlParam(BaseModel): class GoogleHlParam(BaseModel): hl: Optional[GoogleHl] = Field( - title="User Language", + title="User Language (hl)", description=( "User interface language, which can affect search results. See " "https://developers.google.com/custom-search/v1/reference/rest/v1/cse/list#body.QUERY_PARAMETERS.hl" @@ -77,7 +77,7 @@ class GoogleHlParam(BaseModel): class GoogleLrParam(BaseModel): lr: Optional[str] = Field( - title="Content Languages", + title="Content Languages (lr)", description=( "Restricts search results to documents written in the specified " "languages. See "