knitr::opts_chunk$set(
  message = FALSE,
  warning = FALSE,
  fig.retina = 2,
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

omdbapi is an R package wrapper for the Open Movie Database API

NOTE: THE OMDB API NOW REQUIRES AN API KEY https://www.patreon.com/posts/api-is-going-10743518

The following functions are implemented:

News

Installation

devtools::install_github("hrbrmstr/omdbapi")
options(width=80)

Usage

library(omdbapi)
library(tidyverse)

# current verison
packageVersion("omdbapi")

search_by_title("Captain America")

search_by_title("Star Wars", page = 2)

search_by_title("Captain America", year_of_release=2013)

games <- search_by_title("Captain America", type="game")
glimpse(games)

find_by_title(games$Title[1])

find_by_title("Game of Thrones", type="series", season=1, episode=1)

get_genres(find_by_title("Star Trek: Deep Space Nine", season=5, episode=7))

get_writers(find_by_title("Star Trek: Deep Space Nine", season=4, episode=6))

get_directors(find_by_id("tt1371111"))

get_countries(find_by_title("The Blind Swordsman: Zatoichi"))
ichi <- search_by_title("Zatoichi")
pb <- progress_estimated(length(ichi$imdbID))
zato <- purrr::map_df(ichi$imdbID, find_by_id)

zato
ggplot(zato, aes(x="IMDB Rating", imdbRating)) + 
  geom_boxplot() +
  scale_y_continuous(limits=c(0,10)) +
  coord_flip() +
  labs(x=NULL, y=NULL, title="Distribution of IMDB Ratings for Zatoichi movies") +
  hrbrthemes::theme_ipsum_rc(grid="X")

Test Results

library(omdbapi)
library(testthat)

date()

test_dir("tests/")

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.



hrbrmstr/omdbapi documentation built on May 17, 2019, 5:11 p.m.