Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
A tool to ask the internet if it's worth watching this movie.
There are 3 versions to this:
# 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"
It uses the OMDb API to get basic information about the movie.
The ratings are fetched from the following sources:
Get an OMDb API key (one time)
Install binary (one time)
First you'll need to install Crystal.
$ git clone git@github.com: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
Type the title or the IMDb id in the search box
Hit the search button.
Get an OMDb API key (one time)
Call the function
There a some headers and query params to the function:
X-Auth-Token
: the OMDb API keyshow_links
: value "true" to include the source links
in the responseyear
: 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"
$ git clone git@github.com:koffeinfrei/should-i-watch-this.git
$ shards install
$ npm install
$ npm run dev
Navigate to localhost:5000.
cp .env.example .env
.env
npm run dist
export OPENFAAS_URL=https://faasd.koffeinfrei.org
faas template store pull crystal-http --overwrite
faas-cli up --no-cache
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Made with ☕️ by Koffeinfrei