Skip to content

Commit

Permalink
Include the Google parameter ID in the UI for parameter that could be…
Browse files Browse the repository at this point in the history
… confusing otherwise (#95)
  • Loading branch information
Gallaecio authored Dec 11, 2024
1 parent 870e7ef commit 1a2c9fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/test_serp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
),
Expand All @@ -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": [
Expand Down Expand Up @@ -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__)
),
Expand All @@ -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"],
Expand Down
8 changes: 4 additions & 4 deletions zyte_spider_templates/spiders/serp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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 "
Expand Down

0 comments on commit 1a2c9fc

Please sign in to comment.