Skip to content

Commit ceb05ff

Browse files
committed
Fix publication selection bugs
- Restore year filter to current + previous year (2026 is only 15 days old) - Fix XPath selector to search within <ul> only (.//input not //input) This was causing wrong paper selection when checkboxes misaligned
1 parent d09b92e commit ceb05ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

_automation/get_new_papers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ get_new_papers_orcid <- function(orcid, from_date) {
3030
lubridate::parse_date_time(issued, c("Y-m-d", "Y-m", "Y")), "%Y"
3131
))
3232
) |>
33-
dplyr::filter(pub_year >= as.numeric(format(Sys.Date(), "%Y"))) |>
33+
dplyr::filter(pub_year >= as.numeric(format(Sys.Date(), "%Y")) - 1) |>
3434
dplyr::select(-pub_year)
3535
existing_papers <- dois_from_bib("_data/papers.bib")
3636
refs <- refs |>

snippets/update_publications.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bibentries_previous_month <- bibtex::read.bib("bibentries_previous_month.bib")
1818

1919
selected <- last_comment_pubs |>
2020
xml2::xml_find_first("//ul") |>
21-
xml2::xml_find_all("//input") |>
21+
xml2::xml_find_all(".//input") |>
2222
xml2::xml_has_attr("checked")
2323

2424
selected_bibentries <- bibentries_previous_month[selected]

0 commit comments

Comments
 (0)