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

movielens

v0.3.0

Published

Promise based Node API for the movielens unpublished API

Downloads

19

Readme

movielens Build Status

Promise based Node API for the movielens unpublished API.

Installing

Using yarn

$ yarn add movielens

Using npm

$ npm install --save movielens

Methods

login(email, password)

Logs you into your account and returns a Promise containing your cookie (yeah yeah I know, but that the only way movielens authorizes your requests).

const movielens = require('movielens');

movielens.login('[email protected]', 'password')
  .then(function(cookie) {
    console.log('tada', cookie);
  })
  .catch(function(err) {
    console.error(err);
  });

getMe(cookie)

Gets your user information such as: Number of Ratings, Email, User Name, Preferences, and Recommender Type.

getGenres(cookie)

Gets the list of move genres and the top(?) tags in those genres.

getMyTags(cookie)

Gets the tags you have made.

const movielens = require('movielens');

movielens.getMe(cookie)
  .then(function(data) {
    console.log('tada', data);
  })
  .catch(function(err) {
    console.error(err);
  });

rate(cookie, movieId, rating)

Rate a movie.

const movielens = require('movielens');

// give "The Shawshank Redemption" 5 stars
movielens.rate(cookie, 318, 5)
  .then(function(data) {
    console.log('tada', data);
  })
  .catch(function(err) {
    console.error(err);
  });

hide(cookie, movieId)

Hide a movie.

unhide(cookie, movieId)

Unhide a movie.

addToWishlist(cookie, movieId)

Add a movie to your wishlist.

removeFromWishlist(cookie, movieId)

Remove a movie from your wishlist.

explore(cookie, params)

explore() is the query engine to search for movies.

const movielens = require('movielens');

// Get movies acted by 'tom hardy' which I've rated
// 6 results found
var params = {
  actors: 'tom hardy',
  hasRated: 'yes'
}

movielens.explore(cookie, params)
  .then(function(data) {
    console.log('tada', data);
  })
  .catch(function(err) {
    console.error(err);
  });

params references:

|param|type|description| |---|---|---| |page|integer|Page result number (default: 1). A query will return a pager object you will have to make subsequent calls to pull all of the data| |q|string|Movie title query| |directors|string|Director Name query| |actors|string|Actor Name query| |maxDaysAgo|int|Maximum days ago movie was released| |maxFutureDays|int|Maximum days in the future movie will be released| |hasRated|enum|Include or do not include movies you've rated (one of: [yes, no, ignore], default: no)| |sortBy|enum|Data sort type (one of: [userRatedDate, userRating, userRatingDiff, prediction, popularity, releaseDate, dateAdded, tagScore])| |sortDirection|enum|Direction of sorted results (one of: [asc, desc], default: desc| |genre|string|Filter by genre| |tag|string, string[]|Filter by tag(s)| |mpaa|string|Filter by MPAA rating (one of: [g, pg, pg-13, r, nc-17])| |minPop|int|Mininum number of ratings| |maxPop|int|Maximum number of ratings| |minYear|int|Minimum year| |maxYear|int|Maximum year| |hasHidden|enum|Include hidden movies or not (one of: [yes, no, ignore], default: no)| |hasWishlisted|enum|Include movies in your wishlist or not (one of: [yes, no, ignore], default: no)| |languages|enum|Language of the movie or more specifically if the movie has been translated into one of the languages. Despite the name you may only pass one language|

List of languages I've found, there may be more.

Afrikaans      afrikaans
Albanian       shqip
Arabic         العربية
Bambara        bamanankan
Bengali        বাংলা
Bosnian        босански
Bulgarian      български език
Catalan        català
Croatian       hrvatski
Czech          český
Danish         dansk
Dutch          nederlands
English        english
Estonian       eesti
Finnish        suomi
French         français
Galician       galego
Georgian       ქართული
German         deutsch
Greek          ελληνικά
Hebrew         עִבְרִית
Hindi          हिन्दी
Hungarian      magyar
Icelandic      íslenska
Indonesian     bahasa indonesia
Irish          gaeilge
Italian        italiano
Japanese       日本語
Latin          latin
Mandarin       普通话
Norwegian      norsk
Pashto         پښتو
Polish         polski
Portuguese     português
Punjabi        ਪੰਜਾਬੀ
Romanian       română
Russian        pусский
Slovak         slovenčina
Spanish        español
Swahili        kiswahili
Swedish        svenska
Tamil          தமிழ்
Telugu         తెలుగు
Thai           ภาษาไทย
Turkish        türkçe
Ukrainian      український
Urdu           اردو
Vietnamese     tiếng%20việt
Welsh          cymraeg
Wolof          wolof

Various explore() Shortcut Methods

topPicks(cookie, params)

Your top picks

{
  hasRated: 'no',
  sortBy: 'prediction'
}

recentReleases(cookie, params)

Recently released movies.

{
  hasRated: 'no',
  maxDaysAgo: 90,
  maxFutureDays: 0,
  sortBy: 'releaseDate'
}

favoritesYear(cookie, params)

Favorites within the last year.

{
  hasRated: 'no',
  maxDaysAgo: 365,
  maxFutureDays: 0,
  minPop: 100,
  sortBy: 'avgRating'
}

newAdditions(cookie, params)

The movies most recently added to MovieLens.

{
  sortBy: 'dateAdded'
}

getMyRatings(cookie, params)

Movies which you've rated.

{
  hasRated: 'yes',
  sortBy: 'userRatedDate'
}

getMyWishlist(cookie, params)

Movies in your wishlist.

{
  hasWishlisted: 'yes',
  sortBy: 'userListedDate'
}

getMyHiddenMovies(cookie, params)

Movies you've hidden.

{
  hasHidden: 'yes'
}