Skip to content

Latest commit

 

History

History
199 lines (135 loc) · 4.68 KB

README.md

File metadata and controls

199 lines (135 loc) · 4.68 KB

Should I Watch This?

GitHub release   Build Status   License

I watch a lot of movies. This is exactly what I was looking for.
-- myself


This is a tool to ask the internet if it's worth watching a movie or show.

There are 3 versions to this:

CLI  ·  web application  ·  openfaas function


1. CLI

Demo

2. Web application at should-i-watch-this.com

website

3. OpenFaaS function

# basic example
curl -H 'X-Auth-Token: <your omdb token>' \
    https://faasd.koffeinfrei.org/function/should-i-watch-this \
    -d "the terminator"

# example with parameters
curl -H 'X-Auth-Token: <your omdb token>' \
    https://faasd.koffeinfrei.org/function/should-i-watch-this?show_links=true\&year=1984 \
    -d "the terminator"

# example with json response
curl -H 'X-Auth-Token: <your omdb token>' \
    -H "Accept: application/json" \
    https://faasd.koffeinfrei.org/function/should-i-watch-this?show_links=true\&year=1984 \
    -d "the terminator"

About

It uses the OMDb API to get basic information about the movie.

The ratings are fetched from the following sources:

Usage

CLI

# search by title
$ should-i-watch-this lookup "terminator 2"

# search by imdb id
$ should-i-watch-this lookup tt0103064

Install from snap

sudo snap install should-i-watch-this

Install from source

First you'll need to install Crystal.

$ git clone git@github.com:koffeinfrei/should-i-watch-this.git
$ cd should-i-watch-this/cli
$ shards build --release
$ cp bin/should-i-watch-this <some directory in your $PATH>

Web application

  1. Go to https://www.should-i-watch-this.com

  2. Type the title or the IMDb id in the search box

  3. Hit the search button.

OpenFaaS function

  1. Get an OMDb API key (one time)

  2. Call the function

    There a some headers and query params to the function:

    • mandatory
      • header X-Auth-Token: the OMDb API key
    • optional
      • query param show_links: value "true" to include the source links in the response
      • query param year: the year of the movie
    # basic example
    curl -H 'X-Auth-Token: <your omdb token>' \
        https://faasd.koffeinfrei.org/function/should-i-watch-this \
        -d "the terminator"
    
    # example with parameters
    curl -H 'X-Auth-Token: <your omdb token>' \
        https://faasd.koffeinfrei.org/function/should-i-watch-this?show_links=true\&year=1984 \
        -d "the terminator"
    
    # example with json response
    curl -H 'X-Auth-Token: <your omdb token>' \
        -H "Accept: application/json" \
        https://faasd.koffeinfrei.org/function/should-i-watch-this?show_links=true\&year=1984 \
        -d "the terminator"

Development

CLI

$ cd cli
$ shards install

$ crystal run src/should-i-watch-this.cr -- lookup -l the terminator

Web application

$ cd www
$ npm install
$ npm run dev

Navigate to localhost:5000.

OpenFaaS function

Deployment

$ scripts/faas-deploy

Contributing

  1. Fork it (https://github.com/koffeinfrei/should-i-watch-this/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Versioning

Semantic Versioning is used, obviously.

There's a script that bumps the version in all necessary files and creates a git tag.

# bump the major version, e.g. from 1.2.0 to 2.0.0
$ scripts/version bump:major

# bump the minor version, e.g. from 1.2.0 to 1.3.0
$ scripts/version bump:minor

# bump the patch version, e.g. from 1.2.0 to 1.2.1
$ scripts/version bump:patch

Made with ☕️ by Koffeinfrei