Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include the Google parameter ID in the UI for parameter that could be… #95

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading