mayankchd / movie

A CLI for getting information about movies and comparing two movies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How i do provide API key?

schvabodka-man opened this issue · comments

commented

Hi, the app asks me to provide api key, but i really have no clue how to do that and there are no doc page about that

commented

Same issue. "No API key provided"

Please send PR .

commented

Pull request on what?

proving the API key

Hey guys, just to let you know as stated in #2, the API that movie-cli uses is no longer free, and thus the application no longer works.

Just as some constructive feedback, considering this is your application @mayankchd, providing more information about what sort of PR you want us to create or just any more information about the project status would be appreciated.

#6 Helps with this. Right now though, you would have to change the source code. It would be better if you could put your private APi key in a config file, like ~/.config/movie/config.

The file could contain:

api_key = 8jasd98asdf

you should update the readme so we would know that the app won't work before installing it...

#6 Helps with this. Right now though, you would have to change the source code. It would be better if you could put your private APi key in a config file, like ~/.config/movie/config.

The file could contain:

api_key = 8jasd98asdf

Any possibility of a walk through on doing so? (changing API in source, I peeked, possibly not in the right place)

Sure!

  1. Navigate to an empty directory on your computer to keep the source code and run the following command to download the source code for movie:
git clone https://https://github.com/mayankchd/movie.git
  1. Enter the directory:
cd movie/
  1. Find the cli.js file and then locate the section of code where [yourkey] exists:

movie/cli.js

Line 43 in c536684

return 'http://www.omdbapi.com/?apikey=[yourkey]&t='+ mov.trim().replace(/ /g,"+")

  1. Then replace it with your API key. The string should look something like this (assuming your API key is 8jasd98asdf):
'http://www.omdbapi.com/?apikey=8jasd98asdf&t='
  1. Run the commands to install the dependencies and then to install the CLI to your computer:
npm install
npm link

NOTE: if you get ERR! EACCES -13 or anything like that, make sure you put sudo before the command. This error can happen when you're not running the command as an administrator.

  1. You should now be able to use the movie CLI 😄

@FutureQueenBee @sam3d Have fixed this. Added a default key.. Need to make key configurable from CLI though.
Screenshot 2019-06-24 at 1 54 35 AM