-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
316 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
Package: omdbapi | ||
Title: Tools to Access Movie, Television and Game Data from the 'Open Movie Database' | ||
Version: 0.2.0.9000 | ||
Authors@R: c(person("Bob", "Rudis", email = "bob@rudis.net", role = c("aut", "cre"))) | ||
Version: 0.3.0 | ||
Authors@R: c(person("Bob", "Rudis", email = "bob@rud.is", role = c("aut", "cre"))) | ||
Description: Provides API access to the 'Open Movie Database' which maintains metadata | ||
about movies, games and television shows through a public API. | ||
Depends: R (>= 3.1.0) | ||
License: MIT + file LICENSE | ||
LazyData: true | ||
Suggests: testthat | ||
Imports: httr, | ||
dplyr, | ||
stringr | ||
Imports: httr, dplyr, stringr | ||
RoxygenNote: 6.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# omdbapi 0.3.0 | ||
|
||
* Added support for new, required API keys. | ||
* Also moved to use https vs http since API keys are now required and cleartext is bad. | ||
* Added a `NEWS.md` file to track changes to the package. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
# #' Get or set OMDBAPI_KEY value | ||
# #' | ||
# #' The API wrapper functions in this package all rely on a omdb API | ||
# #' key residing in the environment variable \code{OMDBAPI_KEY}. The | ||
# #' easiest way to accomplish this is to set it in the `\code{.Renviron}` file in your | ||
# #' home directory. | ||
# #' | ||
# #' @param force force setting a new omdb API key for the current environment? | ||
# #' @return atomic character vector containing the omdb API key | ||
# #' @note an omdb API key is only necessary for "poster" access | ||
# #' @export | ||
# omdb_api_key <- function(force = FALSE) { | ||
# | ||
# env <- Sys.getenv('OMDBAPI_KEY') | ||
# if (!identical(env, "") && !force) return(env) | ||
# | ||
# if (!interactive()) { | ||
# stop("Please set env var OMDBAPI_KEY to your omdb API key", | ||
# call. = FALSE) | ||
# } | ||
# | ||
# message("Couldn't find env var OMDBAPI_KEY See ?omdb_api_key for more details.") | ||
# message("Please enter your API key and press enter:") | ||
# pat <- readline(": ") | ||
# | ||
# if (identical(pat, "")) { | ||
# stop("PassiveTotal API key entry failed", call. = FALSE) | ||
# } | ||
# | ||
# message("Updating OMDBAPI_KEY env var to PAT") | ||
# Sys.setenv(OMDBAPI_KEY = pat) | ||
# | ||
# pat | ||
# | ||
# } | ||
#' Get or set OMDB_API_KEY value | ||
#' | ||
#' The API wrapper functions in this package all rely on a OMDB API | ||
#' key residing in the environment variable `OMDB_API_KEY`. The | ||
#' easiest way to accomplish this is to set it in the `.Renviron` file in your | ||
#' home directory. | ||
#' | ||
#' @md | ||
#' @param force force setting a new OMDB API key for the current environment? | ||
#' @return atomic character vector containing the OMDB API key | ||
#' @note The "poster" API requires a separate key | ||
#' @export | ||
omdb_api_key <- function(force = FALSE) { | ||
|
||
env <- Sys.getenv('OMDB_API_KEY') | ||
if (!identical(env, "") && !force) return(env) | ||
|
||
if (!interactive()) { | ||
stop("Please set env var OMDB_API_KEY to your OMDB API key", | ||
call. = FALSE) | ||
} | ||
|
||
message("Couldn't find env var OMDB_API_KEY See ?omdb_api_key for more details.") | ||
message("Please enter your API key and press enter:") | ||
pat <- readline(": ") | ||
|
||
if (identical(pat, "")) { | ||
stop("OMDB API key entry failed", call. = FALSE) | ||
} | ||
|
||
message("Updating OMDB_API_KEY env var to PAT") | ||
Sys.setenv(OMDB_API_KEY = pat) | ||
|
||
pat | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#' A package to access movie, television and game metadat via the Open Movie Database API | ||
#' | ||
#' @md | ||
#' @name omdbapi | ||
#' @docType package | ||
#' @author Bob Rudis (@@hrbrmstr) | ||
#' @import httr dplyr | ||
#' @importFrom stringr str_pad | ||
#' @importFrom stringr str_wrap | ||
#' @importFrom stringr str_split | ||
#' @importFrom stringr str_pad str_wrap str_split | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
OMDB_BASE_URL <- "http://www.omdbapi.com/" | ||
OMDB_BASE_URL <- "https://www.omdbapi.com/" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.