Should I Watch This?
A tool to ask the internet if it's worth watching this movie.
There are 3 versions to this:
1. CLI
2. Web aplication at should-i-watch-this.com
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
-
Get an OMDb API key (one time)
-
Install binary (one time)
First you'll need to install Crystal.
$ git clone [email protected]:koffeinfrei/should-i-watch-this.git $ cd should-i-watch-this $ shards build --release $ cp bin/should-i-watch-this <some directory in your $PATH>
-
Execute binary
# search by title $ should-i-watch-this lookup "terminator 2" # search by imdb id $ should-i-watch-this lookup tt0103064
Web application
-
Go to https://www.should-i-watch-this.com
-
Type the title or the IMDb id in the search box
-
Hit the search button.
OpenFaaS function
-
Get an OMDb API key (one time)
-
Call the function
There a some headers and query params to the function:
- mandatory
- header
X-Auth-Token
: the OMDb API key
- header
- optional
- query param
show_links
: value "true" to include the source links in the response - query param
year
: the year of the movie
- query param
# 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"
- mandatory
Development
CLI
$ git clone [email protected]:koffeinfrei/should-i-watch-this.git
$ shards install
Web application
$ npm install
$ npm run dev
Navigate to localhost:5000.
Deployment
Preparation (one time)
cp .env.example .env
- Fill in appropriate values in
.env
Deploy
npm run dist
OpenFaaS function
Deployment
Preparation (one time)
export OPENFAAS_URL=https://faasd.koffeinfrei.org
faas template store pull crystal-http --overwrite
Deploy
faas-cli up --no-cache
Contributing
- Fork it (https://github.com/koffeinfrei/should-i-watch-this/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Made with ☕️ by Koffeinfrei