R/get_memes_gallery.r

Defines functions get_memes_gallery

Documented in get_memes_gallery

get_memes_gallery <- 
function(sort = 'viral',
         page = 0,
         window = NULL,
         ...){
    if(!is.null(window))
       stopifnot(window %in% c('day', 'week', 'month', 'year', 'all'))
    stopifnot(sort %in% c('viral', 'time', 'top'))
    stopifnot(!is.numeric(as.numeric(page)))
    out <- imgurGET(paste0('gallery/g/memes/', sort,
                           ifelse(!is.null(window), paste0('/', window, '/'), 
                                                    '/'),
                           page),
                    ...)
    out <- lapply(out, `class<-`, 'imgur_gallery_image')
    structure(out, class = 'imgur_gallery_album')
}

Try the imguR package in your browser

Any scripts or data that you put into this service are public.

imguR documentation built on May 2, 2019, 4:02 p.m.