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

fix(ky): make date range smaller #1250

Merged
merged 2 commits into from
Nov 21, 2024
Merged
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
12 changes: 9 additions & 3 deletions juriscraper/opinions/united_states/state/ky.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class Site(OpinionSiteLinear):
# Home: https://appellatepublic.kycourts.net/login
first_opinion_date = datetime(1982, 2, 18).date()
days_interval = 10 # page size of 25
days_interval = 7 # page size of 25

api_court = "Kentucky Supreme Court"
api_url = (
Expand Down Expand Up @@ -62,7 +62,7 @@ def set_url(
"""
if not start:
end = datetime.now()
start = end - timedelta(30)
start = end - timedelta(7)

logger.info("Date range %s %s", start, end)
params = {
Expand All @@ -73,8 +73,8 @@ def set_url(
"searchFields[1].operation": "<=",
"searchFields[1].values[0]": end.strftime("%m/%d/%Y"),
"searchFields[1].indexFieldName": "filedDate",
"searchFilters[0].indexFieldName": "caseHeader.court",
"searchFilters[0].operation": "=",
"searchFilters[0].indexFieldName": "caseHeader.court",
"searchFilters[0].values[0]": self.api_court,
}
self.url = f"{self.api_url}{urlencode(params)}"
Expand Down Expand Up @@ -119,6 +119,12 @@ def _process_html(self) -> None:
# May contain the case name
disposition = re.split(self.judge_regex, disposition)[0]

if disposition.upper() in [
"OPINION OF THE COURT",
"OPINION AND ORDER",
]:
disposition = ""

if self.test_mode_enabled():
# detail request has been manually nested in the test file
doc_json = result["detailJson"]
Expand Down
Loading