getChannels: getChannels

Description Usage Arguments Details Author(s) Examples

View source: R/get_channels.R

Description

Returns a collection of zero or more channel resources that match the request criteria.

Usage

1
2
3
getChannels(token, n = 50, part = "snippet", category.id, for.username, id,
  managed.by.me = FALSE, mine = FALSE, hl = NULL, max.results = 50,
  on.behalf.of.content.owner = NULL, verbose = FALSE)

Arguments

token

Your token as returned by youOAuth.

n

Number of results to fecth. The default value is 50.

part

The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The default value is snippet, see findParts or official documentation for all valid values.

category.id

Specifies a YouTube guide category, thereby requesting YouTube channels associated with that category. As returned bygetGuideCategories . The default value is NULL.

for.username

Specifies a YouTube username, thereby requesting the channel associated with that username. The default value is NULL.

id

specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID. The default value is NULL

managed.by.me

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. See scopes under youOAuth. Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the on.behalf.of.content.owner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and on.behalf.of.content.owner must be provided.

mine

Set this parameter's value to true to retrieve a feed of the authenticated user's activities. The default value is FALSE.

hl

The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by getLanguages.

max.results

Specifies the maximum number of results that should be returned by each API call. Acceptable values are 0 to 50, inclusive. The default value is 50.

on.behalf.of.content.owner

Indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. See scope under youOAuth. The default value is NULL.

verbose

If TRUE prints infromational messages in the console. The default value is FALSE.

Details

MUST specify at least one of the following:

Author(s)

John Coene [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# Authenticate
token <- youOAuth(client.id = "something.apps.googleusercontent.com",
                  client.secret = "XxxXX1XxXxXxxx1xxx1xxXXX")
                  
# search channels about cats
search <- searchTube(token, query = "cats", type = "channel")

# pick random id
set.seed(19880525)
chan <- sample(search$channelId, 1)

# fetch
chan.dat <- getChannels(token, id = chan)

## End(Not run)

JohnCoene/youTubeDataR documentation built on May 4, 2018, 8:05 a.m.