#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w(.. lib)) require '../lib/movlog/omdb_api.rb' omdb_keyword = ARGV[0] || ENV['OMDB_KEYWORD'] unless omdb_keyword puts 'USAGE: movlog [omdb_keyword]' exit(1) end movie = Movlog::Movie.find(t: omdb_keyword) puts 'imdb_id: '+movie.imdb_id