npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

imdb-scrapper

v2.3.1

Published

scrap data from imdb web site

Downloads

92

Readme

IMDB Scrapper

This is one stop tool/lib for getting any type of data from IMDB website. For instance, you can get cast(s) of a movie or awards won by that movie and some of it's basic information. All the images function provides images with title and poster of high quality. Every function in this lib is asynchronous, they all return a promise. The module is made to be modular for different functions. It provides many functions:

  1. scrapper(id): id refers to IMDBID like tt1825683. This function provides some basic metadata like genre, runtime, plot etc.
  2. awardsPage(id): id refers to IMDBID like tt1825683. This function provides list of awards won by the movie. By default it provides first three awards or most rated ones.
  3. getCast(id[,n]): id refers to IMDBID like tt1825683, n is optional, it specify number of actors and actresses. By default it is set to 20. This function provide cast of the movies.
  4. getFull(id): id refers to IMDBID like tt1825683. This function is the amalgamation of above three. And its configurations are set to default.
  5. For making a get request use request
  6. getActor(id) : to get detail of the actor id is the actor id like nm43124.This function provide basic info about the actor like name ,birthdate, image etc
  7. searchActor(term):This function provide the serach functionality for actors
  8. episodePage(id,seasonNumber):the season no. is the season which is required
  9. simpleSearch(term) :This provide a fast way to get autocomplete suggestions .Under the hood it uses the imdb api for result.No scrapping is involved in the process.
  10. serach(term) : This provide api to serach for term using scrapping.
  11. getTrendingGenre(genre,n), getTrending(n,type):get movies trending based on genre or type =['tv','movies'].
  12. getStarsBornToday(),getStarsBorn(date):gives the stars born on date or today.
  13. changeQuality(url,n) a function to change the quality of image in url based on the scale of 0-5 n specify the scale .

Check test.js for example of allmost very function usage and returned data ;)

Using above function in different PNC

If awards and cast is only required,

const funs = [awardsPage("tt1825683"), getCast("tt1825683", 14)];
Promise.all(funs)
  .then(data => {
    return { ...data[0], ...data[1] };
  })
  .then(movieDetails => {
    console.log(movieDetails);
  });

To install the package

npm install --save imdb-scrapper

Search APIs

The most important aspect of any movie website is search. This module provides two search strategies:

  1. search(term,n): term represents the search query and n signify the required number of results. The function provide search results from all the genres.
  2. simpleSearch(term): term represents the search query. This function is faster as it directly uses the ajax calls made by IMDB page and is suited for auto complete feature.

Trending Movies

This section is not provided by any other api or scrapper including cast and awards. There are two different ways of scrapping provide by this lib:

  1. getTrending([n]): n is an optional parameter, representing the count of result required. This function provides the trending movies known as trending 250 on IMDB website.
  2. getTrendingGenre(genre [,n]): n is an optional parameter, representing the count of result required. This function provide results sorted on the basis of genres.

Have a look at outputGenerator for expamle and output for output example also have look at example

I hope it helps.

Currenly I am in process of converting this scrapper to use rust under the hood for scrapping, will start with few basic functions and then move towards full rewrite