Skip to content

Commit

Permalink
Merge pull request #1250 from freelawproject/fix_ky
Browse files Browse the repository at this point in the history
fix(ky): make date range smaller
  • Loading branch information
flooie authored Nov 21, 2024
2 parents 76186d0 + 7d7ebb8 commit b08b358
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit b08b358

Please sign in to comment.