Code Monkey home page Code Monkey logo

imdbtr's People

Contributors

brovador avatar dependabot[bot] avatar doppins-bot avatar ekmartin avatar fernahh avatar ndedic avatar romch007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

imdbtr's Issues

Output for movie's 'Plot' seems to have character limit

example:

$ imdbtr "moon" --year 2009

  Moon (2009) on IMDb:

  ★ 7.8

  Duration: .... 2h23min
  Director: .... Duncan Jones
  Writer: ...... Duncan Jones, Nathan Parker
  Stars: ....... Sam Rockwell, Kevin Spacey, Dominique McElligott
  Genre: ....... Drama, Mystery, Sci-Fi
  Plot: ... Astronaut Sam Bell has a quintessentially personal encounter toward the end of his three-year stint on the Moon, where he, working alongside his computer, GERTY, sends back to Earth parcels of a resource that has helped diminish o...

it just cuts off like that.

SyntaxError: Use of const in strict mode.

Using this on Windows, and I'm getting SyntaxError every time I am using imdbtr command followed by the movie name. Example

C:\Users\Anjith Sasindran>imdbtr 'The Godfather'

And this is the error shown

C:\Users\Anjith Sasindran\AppData\Roaming\npm\node_modules\imdbtr\bin\imdbtr:5
const chalk = require('chalk');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

I am using node version 1.4.28

Refactor the project

Problems

api.js

1. Semantic

This module is a function that returns a movie from API provider. I think that must be renamed to getMovie or something like that.

2. The return value

When a movie it's not found, I return false. I think that is better just an empty object or array.

3. Unit tests

They got data from the server. Maybe is better just create mocks.

helpers.js

This module is terrible. Just rewrites in a better way.

bin/imdbtr

It's executable. Terrible too. It should just call the main module. We need to:

  • remove the usage text;
  • remove ugly conditionals.

cli.js

Just remove. Completely unnecessary.

imdbtr.js

The main module. It should just call helper functions, something like that:

const getMovie = require('getMovie')(apiKey) // maybe create a npm module for that
const helpers = require('helpers')

const imdbtr = (params) => {
  getMovie(helpers.buildQueryParams(params))
    .then((data) => {
        console.log(helpers.formattedData(data))
    })
    .catch((error) => {
        console.error(error)
    })
}

module.exports = imdbtr

Tasks

  • Rewrite the api.js
  • Rewrite the helpers.js
  • Refactor the executable
  • Remove cli.js
  • Rewrite imdbtr.js

Error with accented names

Examples:

$ imdbtr "garoto cósmico"
Movie not found on IMDB :(
$ imdbtr "españa 1936"
Movie not found on IMDB :(

Movie not found error

I've installed imdbtr but any movie I search returns the 'Movie not found on IMDB' error. I may be missing something here, but is anyone else having the same problem?

SyntaxError: Use of const in strict mode.

const chalk = require('chalk');
^^^^^
SyntaxError: Use of const in strict mode.
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

issue on node v0.12.2

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.