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:
# 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:
# search by title
$ should-i-watch-this lookup "terminator 2"
# search by imdb id
$ should-i-watch-this lookup tt0103064
sudo snap install should-i-watch-this
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>
-
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:
- 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
$ cd cli
$ shards install
$ crystal run src/should-i-watch-this.cr -- lookup -l the terminator
$ cd www
$ npm install
$ npm run dev
Navigate to localhost:5000.
$ scripts/faas-deploy
- 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
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