@speed_of/imdbscraper
Version:
IMDb scraper for extracting movie reviews from IMDb pages.
100 lines (73 loc) • 1.87 kB
Markdown
IMDb film yorumlarını ve film arama sonuçlarını çeken bir Node.js / React Native kütüphanesi.
```bash
npm install @speed_of/imdbscraper
```
```js
import { imdbScraper } from '@speed_of/imdbscraper';
const reviews = await imdbScraper.getReviews('tt0111161');
```
**Sıralama seçeneği ile:**
```js
// Varsayılan: 'HELPFULNESS_SCORE' (öne çıkan)
await imdbScraper.getReviews('tt0111161', 'HELPFULNESS_SCORE');
// Tarihe göre (en yeni)
await imdbScraper.getReviews('tt0111161', 'SUBMISSION_DATE');
// Toplam oya göre
await imdbScraper.getReviews('tt0111161', 'TOTAL_VOTES');
// Yorum sayısına göre (prolific reviewer)
await imdbScraper.getReviews('tt0111161', 'SUBMITTER_REVIEW_COUNT');
// Puana göre
await imdbScraper.getReviews('tt0111161', 'USER_RATING');
```
**Dönen format:**
```json
[
{
"title": "An incredible movie. One that lives with you.",
"author": "Sleepin_Dragon",
"rating": 10,
"date": "2021-02-17",
"content": "It is no wonder that the film has such a high rating...",
"votes": {
"up": 569,
"down": 45
},
"spoiler": false,
"reviewId": "rw6606154"
}
]
```
---
```js
const movies = await imdbScraper.searchMovie('Inception');
```
**Dönen format:**
```json
[
{
"id": "tt1375666",
"titleNameText": "Inception",
"titleReleaseText": "2010",
"titlePosterImageUrl": "https://m.media-amazon.com/images/...",
"topCredits": ["Leonardo DiCaprio", "Joseph Gordon-Levitt"]
}
]
```
---
```js
const url = imdbScraper.getReviewUrl('rw6606154');
// https://www.imdb.com/review/rw6606154/?ref_=tturv_perm_1
```
---
```bash
npm install
npm run testreview
npm run testsearchmovie
```