node-csfd-api 3.0.0-next.20 → 3.0.0-next.21

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.
Files changed (72) hide show
  1. package/README.md +41 -3
  2. package/{cjs/fetchers → fetchers}/index.js +4 -13
  3. package/{cjs/helpers → helpers}/cinema.helper.js +18 -7
  4. package/{cjs/helpers → helpers}/creator.helper.js +12 -11
  5. package/{types/helpers → helpers}/search.helper.d.ts +1 -1
  6. package/{cjs/helpers → helpers}/search.helper.js +5 -3
  7. package/{cjs/helpers → helpers}/user-ratings.helper.js +2 -1
  8. package/index.js +39 -0
  9. package/package.json +10 -12
  10. package/services/cinema.service.js +34 -0
  11. package/services/creator.service.js +32 -0
  12. package/{cjs/services → services}/movie.service.js +10 -21
  13. package/{cjs/services → services}/search.service.js +8 -19
  14. package/{cjs/services → services}/user-ratings.service.js +25 -36
  15. package/cjs/index.js +0 -58
  16. package/cjs/services/cinema.service.js +0 -45
  17. package/cjs/services/creator.service.js +0 -43
  18. package/esm/fetchers/fetch.polyfill.js +0 -6
  19. package/esm/fetchers/index.js +0 -32
  20. package/esm/helpers/cinema.helper.js +0 -81
  21. package/esm/helpers/creator.helper.js +0 -73
  22. package/esm/helpers/global.helper.js +0 -59
  23. package/esm/helpers/movie.helper.js +0 -228
  24. package/esm/helpers/search-user.helper.js +0 -15
  25. package/esm/helpers/search.helper.js +0 -49
  26. package/esm/helpers/user-ratings.helper.js +0 -47
  27. package/esm/index.js +0 -54
  28. package/esm/interfaces/cinema.interface.js +0 -1
  29. package/esm/interfaces/creator.interface.js +0 -1
  30. package/esm/interfaces/global.js +0 -1
  31. package/esm/interfaces/movie.interface.js +0 -1
  32. package/esm/interfaces/search.interface.js +0 -1
  33. package/esm/interfaces/user-ratings.interface.js +0 -1
  34. package/esm/services/cinema.service.js +0 -41
  35. package/esm/services/creator.service.js +0 -39
  36. package/esm/services/movie.service.js +0 -65
  37. package/esm/services/search.service.js +0 -87
  38. package/esm/services/user-ratings.service.js +0 -91
  39. package/esm/vars.js +0 -7
  40. package/types/index.ts +0 -26
  41. /package/{types/fetchers → fetchers}/fetch.polyfill.d.ts +0 -0
  42. /package/{cjs/fetchers → fetchers}/fetch.polyfill.js +0 -0
  43. /package/{types/fetchers → fetchers}/index.d.ts +0 -0
  44. /package/{types/helpers → helpers}/cinema.helper.d.ts +0 -0
  45. /package/{types/helpers → helpers}/creator.helper.d.ts +0 -0
  46. /package/{types/helpers → helpers}/global.helper.d.ts +0 -0
  47. /package/{cjs/helpers → helpers}/global.helper.js +0 -0
  48. /package/{types/helpers → helpers}/movie.helper.d.ts +0 -0
  49. /package/{cjs/helpers → helpers}/movie.helper.js +0 -0
  50. /package/{types/helpers → helpers}/search-user.helper.d.ts +0 -0
  51. /package/{cjs/helpers → helpers}/search-user.helper.js +0 -0
  52. /package/{types/helpers → helpers}/user-ratings.helper.d.ts +0 -0
  53. /package/{types/index.d.ts → index.d.ts} +0 -0
  54. /package/{types/interfaces → interfaces}/cinema.interface.d.ts +0 -0
  55. /package/{cjs/interfaces → interfaces}/cinema.interface.js +0 -0
  56. /package/{types/interfaces → interfaces}/creator.interface.d.ts +0 -0
  57. /package/{cjs/interfaces → interfaces}/creator.interface.js +0 -0
  58. /package/{types/interfaces → interfaces}/global.d.ts +0 -0
  59. /package/{cjs/interfaces → interfaces}/global.js +0 -0
  60. /package/{types/interfaces → interfaces}/movie.interface.d.ts +0 -0
  61. /package/{cjs/interfaces → interfaces}/movie.interface.js +0 -0
  62. /package/{types/interfaces → interfaces}/search.interface.d.ts +0 -0
  63. /package/{cjs/interfaces → interfaces}/search.interface.js +0 -0
  64. /package/{types/interfaces → interfaces}/user-ratings.interface.d.ts +0 -0
  65. /package/{cjs/interfaces → interfaces}/user-ratings.interface.js +0 -0
  66. /package/{types/services → services}/cinema.service.d.ts +0 -0
  67. /package/{types/services → services}/creator.service.d.ts +0 -0
  68. /package/{types/services → services}/movie.service.d.ts +0 -0
  69. /package/{types/services → services}/search.service.d.ts +0 -0
  70. /package/{types/services → services}/user-ratings.service.d.ts +0 -0
  71. /package/{types/vars.d.ts → vars.d.ts} +0 -0
  72. /package/{cjs/vars.js → vars.js} +0 -0
@@ -1,47 +0,0 @@
1
- import { parseIdFromUrl } from './global.helper';
2
- export const getId = (el) => {
3
- const url = el.querySelector('td.name .film-title-name').attributes.href;
4
- return parseIdFromUrl(url);
5
- };
6
- export const getUserRating = (el) => {
7
- const ratingText = el.querySelector('td.star-rating-only .stars').classNames.split(' ').pop();
8
- const rating = ratingText.includes('stars-') ? +ratingText.split('-').pop() : 0;
9
- return rating;
10
- };
11
- export const getType = (el) => {
12
- const typeText = el.querySelectorAll('td.name .film-title-info .info');
13
- return (typeText.length > 1 ? typeText[1].text.slice(1, -1) : 'film');
14
- };
15
- export const getTitle = (el) => {
16
- return el.querySelector('td.name .film-title-name').text;
17
- };
18
- export const getYear = (el) => {
19
- return +el.querySelectorAll('td.name .film-title-info .info')[0].text.slice(1, -1);
20
- };
21
- export const getColorRating = (el) => {
22
- const color = parseColor(el.querySelector('td.name .icon').classNames.split(' ').pop());
23
- return color;
24
- };
25
- export const getDate = (el) => {
26
- return el.querySelector('td.date-only').text.trim();
27
- };
28
- export const getUrl = (el) => {
29
- const url = el.querySelector('td.name .film-title-name').attributes.href;
30
- return `https://www.csfd.cz${url}`;
31
- };
32
- export const parseColor = (quality) => {
33
- switch (quality) {
34
- case 'lightgrey':
35
- return 'unknown';
36
- case 'red':
37
- return 'good';
38
- case 'blue':
39
- return 'average';
40
- case 'grey':
41
- return 'bad';
42
- default:
43
- return 'unknown';
44
- }
45
- };
46
- // Sleep in loop
47
- export const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
package/esm/index.js DELETED
@@ -1,54 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { CinemaScraper } from './services/cinema.service';
11
- import { CreatorScraper } from './services/creator.service';
12
- import { MovieScraper } from './services/movie.service';
13
- import { SearchScraper } from './services/search.service';
14
- import { UserRatingsScraper } from './services/user-ratings.service';
15
- export class Csfd {
16
- constructor(userRatingsService, movieService, creatorService, searchService, cinemaService) {
17
- this.userRatingsService = userRatingsService;
18
- this.movieService = movieService;
19
- this.creatorService = creatorService;
20
- this.searchService = searchService;
21
- this.cinemaService = cinemaService;
22
- }
23
- userRatings(user, config) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- return this.userRatingsService.userRatings(user, config);
26
- });
27
- }
28
- movie(movie) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- return this.movieService.movie(+movie);
31
- });
32
- }
33
- creator(creator) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- return this.creatorService.creator(+creator);
36
- });
37
- }
38
- search(text) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- return this.searchService.search(text);
41
- });
42
- }
43
- cinema(district, period) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- return this.cinemaService.cinemas(+district, period);
46
- });
47
- }
48
- }
49
- const movieScraper = new MovieScraper();
50
- const userRatingsScraper = new UserRatingsScraper();
51
- const cinemaScraper = new CinemaScraper();
52
- const creatorScraper = new CreatorScraper();
53
- const searchScraper = new SearchScraper();
54
- export const csfd = new Csfd(userRatingsScraper, movieScraper, creatorScraper, searchScraper, cinemaScraper);
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,41 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'node-html-parser';
11
- import { fetchPage } from '../fetchers';
12
- import { cinemasUrl } from '../vars';
13
- import { getCinemaId, getCinemaUrl, getCoords, getGroupedFilmsByDate, parseCinema } from './../helpers/cinema.helper';
14
- export class CinemaScraper {
15
- cinemas(district = 1, period = 'today') {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- const url = cinemasUrl(district, period);
18
- const response = yield fetchPage(url);
19
- const cinemasHtml = parse(response);
20
- const contentNode = cinemasHtml.querySelectorAll('#snippet--cinemas section.box');
21
- this.buildCinemas(contentNode);
22
- return this.cinema;
23
- });
24
- }
25
- buildCinemas(contentNode) {
26
- const cinemas = [];
27
- contentNode.map((x) => {
28
- var _a, _b;
29
- const cinema = {
30
- id: getCinemaId(x),
31
- name: (_a = parseCinema(x)) === null || _a === void 0 ? void 0 : _a.name,
32
- city: (_b = parseCinema(x)) === null || _b === void 0 ? void 0 : _b.city,
33
- url: getCinemaUrl(x),
34
- coords: getCoords(x),
35
- screenings: getGroupedFilmsByDate(x)
36
- };
37
- cinemas.push(cinema);
38
- });
39
- this.cinema = cinemas;
40
- }
41
- }
@@ -1,39 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'node-html-parser';
11
- import { fetchPage } from '../fetchers';
12
- import { getBio, getBirthdayInfo, getFilms, getName, getPhoto } from '../helpers/creator.helper';
13
- import { creatorUrl } from '../vars';
14
- export class CreatorScraper {
15
- creator(creatorId) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- const url = creatorUrl(+creatorId);
18
- const response = yield fetchPage(url);
19
- const creatorHtml = parse(response);
20
- const asideNode = creatorHtml.querySelector('.creator-about');
21
- const filmsNode = creatorHtml.querySelector('.creator-filmography');
22
- this.buildCreator(+creatorId, asideNode, filmsNode);
23
- return this.person;
24
- });
25
- }
26
- buildCreator(id, asideEl, filmsNode) {
27
- var _a, _b, _c;
28
- this.person = {
29
- id,
30
- name: getName(asideEl),
31
- birthday: (_a = getBirthdayInfo(asideEl)) === null || _a === void 0 ? void 0 : _a.birthday,
32
- birthplace: (_b = getBirthdayInfo(asideEl)) === null || _b === void 0 ? void 0 : _b.birthPlace,
33
- photo: getPhoto(asideEl),
34
- age: ((_c = getBirthdayInfo(asideEl)) === null || _c === void 0 ? void 0 : _c.age) || null,
35
- bio: getBio(asideEl),
36
- films: getFilms(filmsNode)
37
- };
38
- }
39
- }
@@ -1,65 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'node-html-parser';
11
- import { fetchPage } from '../fetchers';
12
- import { getBoxMovies, getColorRating, getDescriptions, getDuration, getGenres, getGroup, getOrigins, getPoster, getPremieres, getRandomPhoto, getRating, getRatingCount, getTags, getTitle, getTitlesOther, getTrivia, getType, getVods, getYear } from '../helpers/movie.helper';
13
- import { movieUrl } from '../vars';
14
- export class MovieScraper {
15
- movie(movieId) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- const url = movieUrl(+movieId);
18
- const response = yield fetchPage(url);
19
- const movieHtml = parse(response);
20
- const pageClasses = movieHtml.querySelector('.page-content').classNames.split(' ');
21
- const asideNode = movieHtml.querySelector('.aside-movie-profile');
22
- const movieNode = movieHtml.querySelector('.main-movie-profile');
23
- const jsonLd = movieHtml.querySelector('script[type="application/ld+json"]').innerText;
24
- this.buildMovie(+movieId, movieNode, asideNode, pageClasses, jsonLd);
25
- return this.film;
26
- });
27
- }
28
- buildMovie(movieId, el, asideEl, pageClasses, jsonLd) {
29
- this.film = {
30
- id: movieId,
31
- title: getTitle(el),
32
- year: getYear(jsonLd),
33
- duration: getDuration(jsonLd, el),
34
- descriptions: getDescriptions(el),
35
- genres: getGenres(el),
36
- type: getType(el),
37
- url: movieUrl(movieId),
38
- origins: getOrigins(el),
39
- colorRating: getColorRating(pageClasses),
40
- rating: getRating(asideEl),
41
- ratingCount: getRatingCount(asideEl),
42
- titlesOther: getTitlesOther(el),
43
- poster: getPoster(el),
44
- photo: getRandomPhoto(el),
45
- trivia: getTrivia(el),
46
- creators: {
47
- directors: getGroup(el, 'Režie'),
48
- writers: getGroup(el, 'Scénář'),
49
- cinematography: getGroup(el, 'Kamera'),
50
- music: getGroup(el, 'Hudba'),
51
- actors: getGroup(el, 'Hrají'),
52
- basedOn: getGroup(el, 'Předloha'),
53
- producers: getGroup(el, 'Produkce'),
54
- filmEditing: getGroup(el, 'Střih'),
55
- costumeDesign: getGroup(el, 'Kostýmy'),
56
- productionDesign: getGroup(el, 'Scénografie')
57
- },
58
- vod: getVods(asideEl),
59
- tags: getTags(asideEl),
60
- premieres: getPremieres(asideEl),
61
- related: getBoxMovies(asideEl, 'Související'),
62
- similar: getBoxMovies(asideEl, 'Podobné')
63
- };
64
- }
65
- }
@@ -1,87 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'node-html-parser';
11
- import { fetchPage } from '../fetchers';
12
- import { parseIdFromUrl } from '../helpers/global.helper';
13
- import { getAvatar, getUser, getUserRealName, getUserUrl } from '../helpers/search-user.helper';
14
- import { getColorRating, getOrigins, getPoster, getTitle, getType, getUrl, getYear, parsePeople } from '../helpers/search.helper';
15
- import { searchUrl } from '../vars';
16
- export class SearchScraper {
17
- search(text) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- const url = searchUrl(text);
20
- const response = yield fetchPage(url);
21
- const html = parse(response);
22
- const moviesNode = html.querySelectorAll('.main-movies article');
23
- const usersNode = html.querySelectorAll('.main-users article');
24
- const tvSeriesNode = html.querySelectorAll('.main-series article');
25
- return this.parseSearch(moviesNode, usersNode, tvSeriesNode);
26
- });
27
- }
28
- parseSearch(moviesNode, usersNode, tvSeriesNode) {
29
- const movies = [];
30
- const users = [];
31
- const tvSeries = [];
32
- moviesNode.map((m) => {
33
- const url = getUrl(m);
34
- const movie = {
35
- id: parseIdFromUrl(url),
36
- title: getTitle(m),
37
- year: getYear(m),
38
- url: `https://www.csfd.cz${url}`,
39
- type: getType(m),
40
- colorRating: getColorRating(m),
41
- poster: getPoster(m),
42
- origins: getOrigins(m),
43
- creators: {
44
- directors: parsePeople(m, 'directors'),
45
- actors: parsePeople(m, 'actors')
46
- }
47
- };
48
- movies.push(movie);
49
- });
50
- usersNode.map((m) => {
51
- const url = getUserUrl(m);
52
- const user = {
53
- id: parseIdFromUrl(url),
54
- user: getUser(m),
55
- userRealName: getUserRealName(m),
56
- avatar: getAvatar(m),
57
- url: `https://www.csfd.cz${url}`
58
- };
59
- users.push(user);
60
- });
61
- tvSeriesNode.map((m) => {
62
- const url = getUrl(m);
63
- const user = {
64
- id: parseIdFromUrl(url),
65
- title: getTitle(m),
66
- year: getYear(m),
67
- url: `https://www.csfd.cz${url}`,
68
- type: getType(m),
69
- colorRating: getColorRating(m),
70
- poster: getPoster(m),
71
- origins: getOrigins(m),
72
- creators: {
73
- directors: parsePeople(m, 'directors'),
74
- actors: parsePeople(m, 'actors')
75
- }
76
- };
77
- tvSeries.push(user);
78
- });
79
- const search = {
80
- movies: movies,
81
- users: users,
82
- tvSeries: tvSeries,
83
- creators: []
84
- };
85
- return search;
86
- }
87
- }
@@ -1,91 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { parse } from 'node-html-parser';
11
- import { fetchPage } from '../fetchers';
12
- import { getColorRating, getDate, getId, getTitle, getType, getUrl, getUserRating, getYear, sleep } from '../helpers/user-ratings.helper';
13
- import { userRatingsUrl } from '../vars';
14
- export class UserRatingsScraper {
15
- constructor() {
16
- this.films = [];
17
- }
18
- userRatings(user, config) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- let allMovies = [];
21
- const url = userRatingsUrl(user);
22
- const response = yield fetchPage(url);
23
- const items = parse(response);
24
- const movies = items.querySelectorAll('.box-user-rating .table-container tbody tr');
25
- // Get number of pages
26
- const pagesNode = items.querySelector('.pagination');
27
- const pages = +(pagesNode === null || pagesNode === void 0 ? void 0 : pagesNode.childNodes[pagesNode.childNodes.length - 4].rawText) || 1;
28
- allMovies = this.getPage(config, movies);
29
- if (config === null || config === void 0 ? void 0 : config.allPages) {
30
- console.log('User', user, url);
31
- console.log('Fetching all pages', pages);
32
- for (let i = 2; i <= pages; i++) {
33
- console.log('Fetching page', i, 'out of', pages, '...');
34
- const url = userRatingsUrl(user, i);
35
- const response = yield fetchPage(url);
36
- const items = parse(response);
37
- const movies = items.querySelectorAll('.box-user-rating .table-container tbody tr');
38
- allMovies = [...this.getPage(config, movies)];
39
- // Sleep
40
- if (config.allPagesDelay) {
41
- yield sleep(config.allPagesDelay);
42
- }
43
- }
44
- return allMovies;
45
- }
46
- return allMovies;
47
- });
48
- }
49
- getPage(config, movies) {
50
- var _a, _b, _c, _d;
51
- if (config) {
52
- if (((_a = config.includesOnly) === null || _a === void 0 ? void 0 : _a.length) && ((_b = config.excludes) === null || _b === void 0 ? void 0 : _b.length)) {
53
- console.warn(`node-csfd-api:
54
- You can not use both parameters 'includesOnly' and 'excludes'.
55
- Parameter 'includesOnly' will be used now:`, config.includesOnly);
56
- }
57
- }
58
- for (const el of movies) {
59
- const type = getType(el);
60
- // Filtering includesOnly
61
- if ((_c = config === null || config === void 0 ? void 0 : config.includesOnly) === null || _c === void 0 ? void 0 : _c.length) {
62
- if (config.includesOnly.some((include) => type === include)) {
63
- this.buildUserRatings(el);
64
- }
65
- // Filter exludes
66
- }
67
- else if ((_d = config === null || config === void 0 ? void 0 : config.excludes) === null || _d === void 0 ? void 0 : _d.length) {
68
- if (!config.excludes.some((exclude) => type === exclude)) {
69
- this.buildUserRatings(el);
70
- }
71
- }
72
- else {
73
- // Without filtering
74
- this.buildUserRatings(el);
75
- }
76
- }
77
- return this.films;
78
- }
79
- buildUserRatings(el) {
80
- this.films.push({
81
- id: getId(el),
82
- title: getTitle(el),
83
- year: getYear(el),
84
- type: getType(el),
85
- url: getUrl(el),
86
- colorRating: getColorRating(el),
87
- userDate: getDate(el),
88
- userRating: getUserRating(el)
89
- });
90
- }
91
- }
package/esm/vars.js DELETED
@@ -1,7 +0,0 @@
1
- export const userRatingsUrl = (user, page) => `https://www.csfd.cz/uzivatel/${encodeURIComponent(user)}/hodnoceni/${page ? '?page=' + page : ''}`;
2
- export const movieUrl = (movie) => `https://www.csfd.cz/film/${encodeURIComponent(movie)}/prehled/`;
3
- export const creatorUrl = (creator) => `https://www.csfd.cz/tvurce/${encodeURIComponent(creator)}`;
4
- export const cinemasUrl = (district, period) => {
5
- return `https://www.csfd.cz/kino/?period=${period}&district=${district}`;
6
- };
7
- export const searchUrl = (text) => `https://www.csfd.cz/hledat/?q=${encodeURIComponent(text)}`;
package/types/index.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * @file Automatically generated by barrelsby.
3
- */
4
-
5
- export * from "./index";
6
- export * from "./vars";
7
- export * from "./fetchers/fetch.polyfill";
8
- export * from "./fetchers/index";
9
- export * from "./helpers/cinema.helper";
10
- export * from "./helpers/creator.helper";
11
- export * from "./helpers/global.helper";
12
- export * from "./helpers/movie.helper";
13
- export * from "./helpers/search-user.helper";
14
- export * from "./helpers/search.helper";
15
- export * from "./helpers/user-ratings.helper";
16
- export * from "./interfaces/cinema.interface";
17
- export * from "./interfaces/creator.interface";
18
- export * from "./interfaces/global";
19
- export * from "./interfaces/movie.interface";
20
- export * from "./interfaces/search.interface";
21
- export * from "./interfaces/user-ratings.interface";
22
- export * from "./services/cinema.service";
23
- export * from "./services/creator.service";
24
- export * from "./services/movie.service";
25
- export * from "./services/search.service";
26
- export * from "./services/user-ratings.service";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes