GithubHelp home page GithubHelp logo

murphyjohn / letterboxd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zoetrope69/letterboxd

0.0 1.0 0.0 46 KB

:movie_camera::clapper: get public diary data for letterboxd users

JavaScript 100.00%

letterboxd's Introduction

letterboxd

npm Build Status Dependancies Dev dependancies Commitizen friendly js-semistandard-style Known Vulnerabilities

get public data for letterboxd users

currently only consumes the RSS feeds from letterboxd, when API is released this will be used

installation

npm install letterboxd --save

usage

function(username, [callback])

Returns a promise if no callback is provided.

var letterboxd = require('letterboxd');

letterboxd('rubencordeiro')
  .then(function (items) {
    console.log(items);
  })
  .catch(function (error) {
    console.log(error);
  });

or

var letterboxd = require('letterboxd');

letterboxd('zaccolley', function (error, items){
  if (error) {
    return console.log(error);
  }

  console.log(items);
});

output

output is an array of items.

there are two types of items: diary entries and lists.

due to the limitation of the data source (scraping a RSS feed), only the 20 most recent diary entries are returned

items of note for the list type:

  • ranked: shows if it was set to ranked (1, 2, 3, 4).
  • films: films in the list, capped at 10
  • totalFilms: the total amount of films in the list, only 10 films are given here.

You can use this Glitch app to test out what data comes back: https://letterboxd.glitch.me/zaccolley

[
  {
    type: 'diary',
    film: {
      title: 'Zootopia',
      year: '2016',
      image: { tiny: '...', small: '...', medium: '...', large: '...' }
    },
    rating: { text: '★★★★', score: 4 },
    review: 'proper cute, funny and interesting through out. ...',
    spoilers: false,
    date: { watched: 1463702400000, published: 1463784779000 },
    uri: 'https://letterboxd.com/zaccolley/film/zootopia/'
  },
  //...
  {
    type: 'list',
    date: {
      published: 1473470608000
    },
    title: 'All The Toy Stories',
    description: 'I fucking love these films lol',
    ranked: false,
    films: [
      { title: 'Toy Story', uri: 'https://letterboxd.com/film/toy-story/' },
      { title: 'Toy Story 2', uri: 'https://letterboxd.com/film/toy-story-2/' },
      { title: 'Toy Story 3', uri: 'https://letterboxd.com/film/toy-story-3/' },
      { title: 'Toy Story That Time Forgot', uri: 'https://letterboxd.com/film/toy-story-that-time-forgot/' },
      { title: 'Toy Story of Terror!', uri: 'https://letterboxd.com/film/toy-story-of-terror/' }
    ],
    totalFilms: 56,
    uri: 'https://letterboxd.com/zaccolley/list/tiff-2016/'
  },
  //...
]

letterboxd's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar rubencordeiro avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.