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

what-to-watch

v0.0.4

Published

Score aggregator for lists of movies

Downloads

4

Readme

What-to-Watch

This program takes a list of movie names and outputs their scores given by various websites and how long it takes to beat the movie.

Data is collected from:

  • metacritic.com
  • imdb.com
  • rottentomatoes.com

The output format is either of:

  • CSV (default) (compatible with popular spreadsheet software)
  • JSON

This program can be used:

  • on the command line reading from stdin or a file;
  • as an npm package.

You can specify the gaming platforms you use to improve score relevancy, and you can improve search results by specifying your country.

Prerequisites

If you're a non-technical person looking at this, I'm sorry. This code won't run in a browser due to browser security preventing requests between websites. Although I could set something up on a server and have all the data downloaded on the server side, it would be too slow with multiple concurrent users due to the way these websites prevent spam by blocking too many requests from a single origin.

How to Run

Run without install:

npx what-to-watch ...

Global install:

sudo npm install --global what-to-watch
what-to-watch ...

Dependency:

npm install what-to-watch
npx what-to-watch ...

From source:

git clone https://github.com/Deskbot/what-to-watch --depth 1
cd what-to-watch
npm install
npm run build
npm run main -- ...

Arguments

Usage: command (file path)? (arguments)*

If a file is given, the file will be used as input, otherwise stdin is used.

Input format: movie titles on separate lines

Arguments:
-h | --help      : Print help.
--readme         : Print the readme.
--json           : Output in JSON format (instead of CSV).
--rate-limit     : Limit how many movies will be searched for simultaneously from each website.

e.g. what-to-watch list_of_movies.txt --json

Library Usage

See src/api.ts for what exactly is available.

The main functions to look at are in src/output.ts. Functions for getting a subset of the output data are exposed under namespaces in src/api.ts.

In terms of API stability. You can trust exports from src/output.ts to be less likely to change than other exports, but I'll try to keep to semantic versioning.

This package depends on NodeJS libraries. It won't run in browser due to CORS policy implemented by browsers.

Output

The default format is CSV.

The scores are reported the same as on the website the score came from, they are not normalised to be out of the same possible maximum.

The CSV columns and JSON fields are pretty self-explanatory and may change over time, so they are not specified here.

The output includes the title of the movie as interpreted by each website. You should check this to be sure that the information you're seeing is actually for the given movie.

For various reasons, a movie or score might not be found from the website. As a CSV, this leaves an empty field. In JSON, the field is not present.

Understanding the Numbers

| Number | Maximum | | ------------------------------ | ------- | | Metacritic Critic Score | 100 | | Metacritic User Score | 10 | | IMDB Score | 10 | | Rotten Tomatoes Critic Score | 100 | | Rotten Tomatoes Audience Score | 100 |

The aggregate score exists so that there will be a score column filled in for every row for ease of sorting. However, doing this will skew movies that exist on Steam further to the top because Steam's review system means it yields scores closer to 100.

Shortcomings

Movies with similar names could be confused for one another. An effort has been made to choose the best search result offered by each website, which is more accurate than taking the top result.

The movie found by each website is included in the output so you know whether the score displayed is for the movie you're looking for.

When there are multiple equally good matches, it is assumed that you are searching for the best one.

There are often multiple movies with the same name released in different years. If you include the year at the end of your input, it will be factored into the results.

Format Differences

The JSON output has fields for hyperlinks to where the data came from. In the CSV output, these urls are encoded as hyperlinks in the cell containing the related data.

The hyperlinks are encoded as =HYPERLINK("url","label"), which is a valid formula with the same behaviour across Libre Office Calc, Google Sheets, and Microsoft Office Excel, and probably several others.

Privacy

Be aware that by running the software, you may be subject to aspects of the privacy policies of the websites visited. The websites that could be visited are listed above.

This program does not send any cookies to those sites and scripts on the queried web pages are never executed. So it is not the same as if you were to visit these sites manually.

License

The license is a slightly modified version of the MIT license to require that you to provide a notice about privacy like the one above.