node-csfd-api 2.7.12 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/helpers/creator.helper.js +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
[](https://github.com/bartholomej/node-csfd-api/actions)
|
|
4
4
|
[](https://codecov.io/gh/bartholomej/node-csfd-api)
|
|
5
5
|
|
|
6
|
-
# CSFD API 🎥
|
|
6
|
+
# CSFD API 🎥 2025
|
|
7
7
|
|
|
8
8
|
> JavaScript NPM library for scraping **Czech Movie Database (csfd.cz)**
|
|
9
9
|
>
|
|
10
10
|
> - JavaScript / TypeScript
|
|
11
11
|
> - Browser + Node.js (SSR)
|
|
12
12
|
> - Tested (~100% Code coverage)
|
|
13
|
-
> - ✅ Ready for new ČSFD
|
|
13
|
+
> - ✅ Ready for new ČSFD 2025!
|
|
14
14
|
> - You can use in:
|
|
15
15
|
> - Firebase function
|
|
16
16
|
> - AWS λ (lambda function)
|
|
@@ -463,7 +463,7 @@ That's why, with node-csfd-api, what happens on your device stays on your device
|
|
|
463
463
|
|
|
464
464
|
## 📝 License
|
|
465
465
|
|
|
466
|
-
Copyright © 2020 –
|
|
466
|
+
Copyright © 2020 – 2025 [Lukas Bartak](http://bartweb.cz)
|
|
467
467
|
|
|
468
468
|
Proudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)
|
|
469
469
|
|
|
@@ -18,19 +18,19 @@ const getName = (el) => {
|
|
|
18
18
|
};
|
|
19
19
|
exports.getName = getName;
|
|
20
20
|
const getBirthdayInfo = (el) => {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const infoBlock = el.querySelector('h1 + p');
|
|
23
|
+
const text = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.innerHTML.trim();
|
|
24
|
+
const birthPlaceRow = (_a = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.querySelector('.info-place')) === null || _a === void 0 ? void 0 : _a.innerHTML.trim();
|
|
25
|
+
const ageRow = (_b = infoBlock === null || infoBlock === void 0 ? void 0 : infoBlock.querySelector('.info')) === null || _b === void 0 ? void 0 : _b.innerHTML.trim();
|
|
26
|
+
let birthday = '';
|
|
27
|
+
if (text) {
|
|
28
|
+
const parts = text.split('\n');
|
|
27
29
|
const birthdayRow = parts.find((x) => x.includes('nar.'));
|
|
28
|
-
const ageRow = parts.find((x) => x.includes('let)'));
|
|
29
|
-
const birthPlaceRow = parts.find((x) => x.includes('<br>')); // Ugly but there is no other way to detect
|
|
30
30
|
birthday = birthdayRow ? (0, exports.parseBirthday)(birthdayRow) : '';
|
|
31
|
-
age = ageRow ? +(0, exports.parseAge)(ageRow) : null;
|
|
32
|
-
birthPlace = birthPlaceRow ? (0, exports.parseBirthPlace)(birthPlaceRow) : '';
|
|
33
31
|
}
|
|
32
|
+
const age = ageRow ? +(0, exports.parseAge)(ageRow) : null;
|
|
33
|
+
const birthPlace = birthPlaceRow ? (0, exports.parseBirthPlace)(birthPlaceRow) : '';
|
|
34
34
|
return { birthday, age, birthPlace };
|
|
35
35
|
};
|
|
36
36
|
exports.getBirthdayInfo = getBirthdayInfo;
|