node-csfd-api
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -1,1 +0,12 @@ | ||
export { Csfd } from './scraper'; | ||
import { CSFDFilmTypes } from './interfaces/global'; | ||
import { CSFDUserRatings } from './interfaces/user-ratings'; | ||
import { UserRatingsScraper } from './services/user-ratings'; | ||
export declare class Csfd { | ||
private userRatingsService; | ||
constructor(userRatingsService: UserRatingsScraper); | ||
userRatings(user: string | number, config?: { | ||
includesOnly?: CSFDFilmTypes[]; | ||
excludes?: CSFDFilmTypes[]; | ||
}): Promise<CSFDUserRatings[]>; | ||
} | ||
export declare const csfd: Csfd; |
16
index.js
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Csfd = void 0; | ||
var scraper_1 = require("./scraper"); | ||
Object.defineProperty(exports, "Csfd", { enumerable: true, get: function () { return scraper_1.Csfd; } }); | ||
exports.csfd = exports.Csfd = void 0; | ||
const user_ratings_1 = require("./services/user-ratings"); | ||
class Csfd { | ||
constructor(userRatingsService) { | ||
this.userRatingsService = userRatingsService; | ||
} | ||
async userRatings(user, config) { | ||
return this.userRatingsService.userRatings(user, config); | ||
} | ||
} | ||
exports.Csfd = Csfd; | ||
const userRatingsScraper = new user_ratings_1.UserRatingsScraper(); | ||
exports.csfd = new Csfd(userRatingsScraper); |
{ | ||
"name": "node-csfd-api", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Simple NPM library for scraping CSFD", | ||
@@ -21,2 +21,6 @@ "main": "./index.js", | ||
}, | ||
"dependencies": { | ||
"cross-fetch": "^3.0.6", | ||
"node-html-parser": "^1.4.8" | ||
}, | ||
"repository": { | ||
@@ -43,8 +47,4 @@ "url": "git+https://github.com/bartholomej/csfd-ratings.git", | ||
"license": "MIT", | ||
"dependencies": { | ||
"cross-fetch": "^3.0.6", | ||
"node-html-parser": "^1.4.5" | ||
}, | ||
"module": "./index.js", | ||
"types": "./index.d.ts" | ||
} |
@@ -0,1 +1,6 @@ | ||
[![npm version](https://badge.fury.io/js/node-csfd-api.svg)](https://badge.fury.io/js/node-csfd-api) | ||
[![Package License](https://img.shields.io/npm/l/node-csfd-api.svg)](https://www.npmjs.com/node-csfd-api) | ||
[![Build & Publish](https://github.com/bartholomej/node-csfd-api/workflows/Build%20&%20Publish/badge.svg)](https://github.com/bartholomej/node-csfd-api/actions) | ||
[![codecov](https://codecov.io/gh/bartholomej/node-csfd-api/branch/master/graph/badge.svg?token=YQH9UoVrGP)](https://codecov.io/gh/bartholomej/node-csfd-api) | ||
# CSFD API | ||
@@ -29,6 +34,4 @@ | ||
```javascript | ||
import { Csfd } from 'node-csfd-api'; | ||
import { csfd } from 'node-csfd-api'; | ||
const csfd = new Csfd(); | ||
csfd.userRatings('912-bart').then((ratings) => console.log(ratings)); | ||
@@ -42,9 +45,18 @@ ``` | ||
{ | ||
title: 'Watchmen - This Extraordinary Being (E06)', | ||
year: 2019, | ||
type: 'epizoda', | ||
title: 'David Attenborough: Život na naší planetě', | ||
year: 2020, | ||
type: 'film', | ||
rating: 5, | ||
url: 'https://www.csfd.cz', | ||
date: '25.11.2019', | ||
quality: 1 | ||
url: 'https://www.csfd.cz/film/812944-david-attenborough-zivot-na-nasi-planete/', | ||
date: '01.11.2020', | ||
overallRating: 1 | ||
}, | ||
{ | ||
title: 'Coronation', | ||
year: 2020, | ||
type: 'film', | ||
rating: 4, | ||
url: 'https://www.csfd.cz/film/912552-coronation/', | ||
date: '28.10.2020', | ||
overallRating: 1 | ||
} | ||
@@ -51,0 +63,0 @@ ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11237
16
179
111
1
Updatednode-html-parser@^1.4.8