getSubscriptions: getSubscriptions

Description Usage Arguments Details Author(s) Examples

View source: R/get_subscriptions.R

Description

Returns subscription resources that match the API request criteria.

Usage

1
2
3
4
5
getSubscriptions(token, part = "snippet", channel.id, id, mine = FALSE,
  my.subscribers = FALSE, max.results = 50, n = 50,
  for.channel.id = NULL, on.behalf.of.content.owner = NULL,
  order = "relevance", on.behalf.of.content.owner.channel = NULL,
  verbose = FALSE)

Arguments

token

Your token as returned by youOAuth.

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 for all valid values.

channel.id

Specifies a YouTube channel ID. The API will only return that channel's subscriptions.

id

Specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.

mine

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

my.subscribers

This parameter can only be used in a properly authorized request. Set this parameter's value to TRUE to retrieve a feed of the subscribers of the authenticated user.

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.

n

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

for.channel.id

Specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.

on.behalf.of.content.owner

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. 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 CMS account that the user authenticates with must be linked to the specified YouTube content owner. The default value is NULL, must be used in conjonction with on.behalf.of.content.owner.channel.channel

order

Specifies the method that will be used to sort resources in the API response. The default value is relevance, see findParams.

on.behalf.of.content.owner.channel

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. Specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the on.behalf.of.content.owner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the on.behalf.of.content.owner parameter specifies. Finally, the channel that the on.behalf.of.content.owner.channel parameter value specifies must be linked to the content owner that the on.behalf.of.content.owner parameter specifies.

verbose

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

Details

Must specify one (and only one) channel.id, id, mine (TRUE), my.subscribers (TRUE)

Official documentation on this API call; https://developers.google.com/youtube/v3/docs/playlists/list

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
search <- searchTube(token, query = "cats", type = "channel")

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

# fetch subs
subs <- getSubscriptions(token, channel.id = chan)

## End(Not run)

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