knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
ravelRy is an R package that provides access to the Ravelry API.
Ravelry describes itself as a place for knitters, crocheters, designers, spinners, weavers and dyers to keep track of their yarn, tools, project and pattern information, and look to others for ideas and inspiration.
Hex sticker yarn icon by Eucalyp via Flaticon.
You can install the development version of ravelRy from Github:
devtools::install_github("walkerkq/ravelRy")
Or the release via CRAN:
install.packages("ravelRy")
RAVELRY_USERNAME
and RAVELRY_PASSWORD
in your .renviron file or via the console with the ravelry_auth()
function. library(ravelRy) ravelry_auth(key = 'username') # you will be prompted to enter your username via the console ravelry_auth(key = 'password') # you will be prompted to enter your password via the console
Retrieve a list of free patterns for baby hats.
library(ravelRy) search_results <- search_patterns(query = 'hat', page_size = 5, availability = 'free', fit = 'baby') str(search_results, max.level = 1)
Get pattern details for those ids.
patterns <- get_patterns(ids = search_results$id) str(patterns, max.level = 1)
More examples can be found here.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.