knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(BrkbadWiki) library(knitr)
Breaking Bad is regarded as one of the greatest tv series of all time. It receives more than 1 million ratings from IMDB users, and the average rating is a remarkable 9.5. One of the fans of this show created an API website that contains detailed information about the 63 characters that appeared in the show and all episodes. My goal is to extract information from the API and create a package that allows the user to search for the information they want to know about the show, like a character's nickname, the name of the actor or actress that portrayed a specific character, or even the number of deaths an individual is responsible for. I want my API client to be a Breaking Bad Wiki that allows the users to look up information that interests them.
The documentation of the Breaking Bad API can be accessed by navigating to https://breakingbadapi.com/Documentation, and the base Url is https://www.breakingbadapi.com/api/. The Breaking Bad API has four different endpoints: characters, episodes, quote, and deaths.
The BrkbadWiki
package contains four functions: option()
, characters()
, cast()
, and death()
.
limit
) : Limit the amount of characters users receive. default to the full list (63).kable(option(10))
id
) : The id of the character the user wants to search for, it can also be the full name of the character. (like 'Walter White')func
) : Specify what exactly the user wants to know about this character, valid inputs include display(all available information), occupation, status, death count, portrayed and image. Display is the default.func
) information about a character.kable(characters(7, "display"))
characters("Mike Ehrmantraut", "image")
id
) : The id of the character (portrayed by the actor/actress the user is interested in) the user wants to search for, it can also be the full name of the character. (like "Walter White")kable(cast("Mike Ehrmantraut"))
func
) : Specify what the user wants this function to perform, valid inputs include random(some information about a death at random), all(retrieve information about every death happened in Breaking Bad) and search(search for death scenarios by a specific cause)weapon
) : The casue of death, valid input include ("gun","shot","stab","knive","bomb","poison","strangle","garrote","crush","beat","decapitate","overdose","slit","collide")kable(death('random'))
kable(death('search', 'bomb'))
The package maintainer: Please e-mail me at cz2581@columbia.edu
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.