node-csfd-api
Advanced tools
Comparing version 3.0.0-next.15 to 3.0.0-next.16
@@ -18,5 +18,5 @@ "use strict"; | ||
class CinemaScraper { | ||
cinemas(district) { | ||
cinemas(district = 1, period = 'today') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const url = (0, vars_1.cinemasUrl)(district, 'week'); | ||
const url = (0, vars_1.cinemasUrl)(district, period); | ||
const response = yield (0, fetchers_1.fetchPage)(url); | ||
@@ -23,0 +23,0 @@ const cinemasHtml = (0, node_html_parser_1.parse)(response); |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.creatorUrl = creatorUrl; | ||
const cinemasUrl = (district = 1, period = 'today') => { | ||
const cinemasUrl = (district, period) => { | ||
return `https://www.csfd.cz/kino/?period=${period}&district=${district}`; | ||
@@ -13,0 +13,0 @@ }; |
@@ -15,5 +15,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
export class CinemaScraper { | ||
cinemas(district) { | ||
cinemas(district = 1, period = 'today') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const url = cinemasUrl(district, 'week'); | ||
const url = cinemasUrl(district, period); | ||
const response = yield fetchPage(url); | ||
@@ -20,0 +20,0 @@ const cinemasHtml = parse(response); |
export const userRatingsUrl = (user, page) => `https://www.csfd.cz/uzivatel/${encodeURIComponent(user)}/hodnoceni/${page ? '?page=' + page : ''}`; | ||
export const movieUrl = (movie) => `https://www.csfd.cz/film/${encodeURIComponent(movie)}/prehled/`; | ||
export const creatorUrl = (creator) => `https://www.csfd.cz/tvurce/${encodeURIComponent(creator)}`; | ||
export const cinemasUrl = (district = 1, period = 'today') => { | ||
export const cinemasUrl = (district, period) => { | ||
return `https://www.csfd.cz/kino/?period=${period}&district=${district}`; | ||
}; | ||
export const searchUrl = (text) => `https://www.csfd.cz/hledat/?q=${encodeURIComponent(text)}`; |
{ | ||
"name": "node-csfd-api", | ||
"version": "3.0.0-next.15", | ||
"version": "3.0.0-next.16", | ||
"description": "ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
@@ -23,1 +23,2 @@ import { CSFDMovieListItem } from './movie.interface'; | ||
export type CSFDCinemaMeta = 'dubbing' | '3D' | 'subtitles' | string; | ||
export type CSFDCinemaPeriod = 'today' | 'weekend' | 'week' | 'tomorrow' | 'month'; |
@@ -1,6 +0,6 @@ | ||
import { CSFDCinema } from '../interfaces/cinema.interface'; | ||
import { CSFDCinema, CSFDCinemaPeriod } from '../interfaces/cinema.interface'; | ||
export declare class CinemaScraper { | ||
private cinema; | ||
cinemas(district: number): Promise<CSFDCinema[]>; | ||
cinemas(district?: number, period?: CSFDCinemaPeriod): Promise<CSFDCinema[]>; | ||
private buildCinemas; | ||
} |
@@ -0,5 +1,6 @@ | ||
import { CSFDCinemaPeriod } from 'interfaces/cinema.interface'; | ||
export declare const userRatingsUrl: (user: string | number, page?: number) => string; | ||
export declare const movieUrl: (movie: number) => string; | ||
export declare const creatorUrl: (creator: number | string) => string; | ||
export declare const cinemasUrl: (district?: number | string, period?: 'today' | 'weekend' | 'week' | 'tomorrow' | 'month') => string; | ||
export declare const cinemasUrl: (district: number | string, period: CSFDCinemaPeriod) => string; | ||
export declare const searchUrl: (text: string) => string; |
120702
2439