daranzolin / rcanvas

R Client for Canvas LMS API
Other
90 stars 43 forks source link

pages body #32

Open jcorelli opened 6 years ago

jcorelli commented 6 years ago

get_course_item(courseid,'pages') does not bring back the body field. How can I get the html code from the page?

jonovik commented 5 years ago
library(tidyverse)
library(rcanvas)

COURSE_NAME <- "<insert word(s) from course name here>"
PAGE_TITLE <- "<insert word(s) from page title here>"

course_id <- get_course_list() %>% 
  filter(name %>% str_detect(COURSE_NAME)) %>% 
  pull(id)
page_url <- get_course_items(course_id, "pages") %>% 
  filter(title %>% str_detect(PAGE_TITLE)) %>% 
  pull(url)
body <- get_wpage(course_id, page_url) %>% 
  pull(body)

# rcanvas version: 0.0.0.9001 2019-08-14 local (daranzolin/rcanvas@31f7eab)
scottkosty commented 4 years ago

@jcorelli Did the above comment answer your question?