Skip to content

Commit

Permalink
2024 (closes #15) (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
d10xa authored Sep 28, 2023
1 parent 6b35f5f commit c101e53
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 8 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[2021](json/superjob2021.json)
[2022](json/superjob2022.json)
[2023](json/superjob2023.json)
[2024](json/superjob2024.json)

## consultant

Expand All @@ -38,6 +39,7 @@
[2021](json/consultant2021.json)
[2022](json/consultant2022.json)
[2023](json/consultant2023.json)
[2024](json/consultant2024.json)

## json structure

Expand Down Expand Up @@ -105,26 +107,27 @@ downloadCalendar.doLast {

Исходный код страниц можно взять из браузера. Пример прямых ссылок для chrome:

view-source:https://www.superjob.ru/proizvodstvennyj_kalendar/2023/
view-source:https://www.consultant.ru/law/ref/calendar/proizvodstvennye/2023/
view-source:https://www.superjob.ru/proizvodstvennyj_kalendar/2024/
view-source:https://www.consultant.ru/law/ref/calendar/proizvodstvennye/2024/

Как альтернативный вариант, можно использовать headless chrome:

mkdir html
export YEAR=2023

mkdir html

export YEAR=2024
google-chrome --headless --disable-gpu --crash-dumps-dir=/tmp --dump-dom "https://www.superjob.ru/proizvodstvennyj_kalendar/$YEAR" > "html/superjob$YEAR.html"
google-chrome --headless --disable-gpu --crash-dumps-dir=/tmp --dump-dom "https://www.consultant.ru/law/ref/calendar/proizvodstvennye/$YEAR/" > "html/consultant$YEAR.html"


Запуск парсера superjob:

export YEAR=2023
export YEAR=2024
./gradlew runSuperjob --args="--input $PWD/html/superjob$YEAR.html --output $PWD/json/superjob$YEAR.json"

Запуск парсера consultant:

export YEAR=2023
export YEAR=2024
./gradlew runConsultant --args="--input $PWD/html/consultant$YEAR.html --output $PWD/json/consultant$YEAR.json"


Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MergeHolidaysJsonTask extends DefaultTask {
@OutputFile
File output

@Input
Set<String> exclude = []

@TaskAction
Expand Down
127 changes: 125 additions & 2 deletions json/calendar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,125 @@
"2023-12-23",
"2023-12-24",
"2023-12-30",
"2023-12-31"
"2023-12-31",
"2024-01-01",
"2024-01-02",
"2024-01-03",
"2024-01-04",
"2024-01-05",
"2024-01-06",
"2024-01-07",
"2024-01-08",
"2024-01-13",
"2024-01-14",
"2024-01-20",
"2024-01-21",
"2024-01-27",
"2024-01-28",
"2024-02-03",
"2024-02-04",
"2024-02-10",
"2024-02-11",
"2024-02-17",
"2024-02-18",
"2024-02-23",
"2024-02-24",
"2024-02-25",
"2024-03-02",
"2024-03-03",
"2024-03-08",
"2024-03-09",
"2024-03-10",
"2024-03-16",
"2024-03-17",
"2024-03-23",
"2024-03-24",
"2024-03-30",
"2024-03-31",
"2024-04-06",
"2024-04-07",
"2024-04-13",
"2024-04-14",
"2024-04-20",
"2024-04-21",
"2024-04-28",
"2024-04-29",
"2024-04-30",
"2024-05-01",
"2024-05-04",
"2024-05-05",
"2024-05-09",
"2024-05-10",
"2024-05-11",
"2024-05-12",
"2024-05-18",
"2024-05-19",
"2024-05-25",
"2024-05-26",
"2024-06-01",
"2024-06-02",
"2024-06-08",
"2024-06-09",
"2024-06-12",
"2024-06-15",
"2024-06-16",
"2024-06-22",
"2024-06-23",
"2024-06-29",
"2024-06-30",
"2024-07-06",
"2024-07-07",
"2024-07-13",
"2024-07-14",
"2024-07-20",
"2024-07-21",
"2024-07-27",
"2024-07-28",
"2024-08-03",
"2024-08-04",
"2024-08-10",
"2024-08-11",
"2024-08-17",
"2024-08-18",
"2024-08-24",
"2024-08-25",
"2024-08-31",
"2024-09-01",
"2024-09-07",
"2024-09-08",
"2024-09-14",
"2024-09-15",
"2024-09-21",
"2024-09-22",
"2024-09-28",
"2024-09-29",
"2024-10-05",
"2024-10-06",
"2024-10-12",
"2024-10-13",
"2024-10-19",
"2024-10-20",
"2024-10-26",
"2024-10-27",
"2024-11-03",
"2024-11-04",
"2024-11-09",
"2024-11-10",
"2024-11-16",
"2024-11-17",
"2024-11-23",
"2024-11-24",
"2024-11-30",
"2024-12-01",
"2024-12-07",
"2024-12-08",
"2024-12-14",
"2024-12-15",
"2024-12-21",
"2024-12-22",
"2024-12-29",
"2024-12-30",
"2024-12-31"
],
"preholidays": [
"2011-02-22",
Expand Down Expand Up @@ -1592,7 +1710,12 @@
"2022-11-03",
"2023-02-22",
"2023-03-07",
"2023-11-03"
"2023-11-03",
"2024-02-22",
"2024-03-07",
"2024-05-08",
"2024-06-11",
"2024-11-02"
],
"nowork": [
"2020-03-30",
Expand Down
129 changes: 129 additions & 0 deletions json/consultant2024.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"holidays": [
"2024-01-01",
"2024-01-02",
"2024-01-03",
"2024-01-04",
"2024-01-05",
"2024-01-06",
"2024-01-07",
"2024-01-08",
"2024-01-13",
"2024-01-14",
"2024-01-20",
"2024-01-21",
"2024-01-27",
"2024-01-28",
"2024-02-03",
"2024-02-04",
"2024-02-10",
"2024-02-11",
"2024-02-17",
"2024-02-18",
"2024-02-23",
"2024-02-24",
"2024-02-25",
"2024-03-02",
"2024-03-03",
"2024-03-08",
"2024-03-09",
"2024-03-10",
"2024-03-16",
"2024-03-17",
"2024-03-23",
"2024-03-24",
"2024-03-30",
"2024-03-31",
"2024-04-06",
"2024-04-07",
"2024-04-13",
"2024-04-14",
"2024-04-20",
"2024-04-21",
"2024-04-28",
"2024-04-29",
"2024-04-30",
"2024-05-01",
"2024-05-04",
"2024-05-05",
"2024-05-09",
"2024-05-10",
"2024-05-11",
"2024-05-12",
"2024-05-18",
"2024-05-19",
"2024-05-25",
"2024-05-26",
"2024-06-01",
"2024-06-02",
"2024-06-08",
"2024-06-09",
"2024-06-12",
"2024-06-15",
"2024-06-16",
"2024-06-22",
"2024-06-23",
"2024-06-29",
"2024-06-30",
"2024-07-06",
"2024-07-07",
"2024-07-13",
"2024-07-14",
"2024-07-20",
"2024-07-21",
"2024-07-27",
"2024-07-28",
"2024-08-03",
"2024-08-04",
"2024-08-10",
"2024-08-11",
"2024-08-17",
"2024-08-18",
"2024-08-24",
"2024-08-25",
"2024-08-31",
"2024-09-01",
"2024-09-07",
"2024-09-08",
"2024-09-14",
"2024-09-15",
"2024-09-21",
"2024-09-22",
"2024-09-28",
"2024-09-29",
"2024-10-05",
"2024-10-06",
"2024-10-12",
"2024-10-13",
"2024-10-19",
"2024-10-20",
"2024-10-26",
"2024-10-27",
"2024-11-03",
"2024-11-04",
"2024-11-09",
"2024-11-10",
"2024-11-16",
"2024-11-17",
"2024-11-23",
"2024-11-24",
"2024-11-30",
"2024-12-01",
"2024-12-07",
"2024-12-08",
"2024-12-14",
"2024-12-15",
"2024-12-21",
"2024-12-22",
"2024-12-29",
"2024-12-30",
"2024-12-31"
],
"preholidays": [
"2024-02-22",
"2024-03-07",
"2024-05-08",
"2024-06-11",
"2024-11-02"
]
}
Loading

0 comments on commit c101e53

Please sign in to comment.