class Yt::Collections::Subscribers
Provides methods to interact with subscribers of a YouTube resource.
Resources
with subscribers are: {Yt::Models::Account accounts}.
Confusingly, YouTube API provides the same
endpoint to either retrieve the channels that you are subscribed to or the channels that are subscribed to you. The difference relies in the setting the mySubscribers
parameter to true and in reading the information from the subscriberSnippet
part, not the snippet
part. @see developers.google.com/youtube/v3/docs/subscriptions/list
Private Instance Methods
Source
# File lib/yt/collections/subscribers.rb, line 19 def attributes_for_new_item(data) snippet = data.fetch 'subscriberSnippet', {} {id: snippet['channelId'], snippet: snippet, auth: @auth} end
Source
# File lib/yt/collections/subscribers.rb, line 24 def channels_params {}.tap do |params| params[:max_results] = 50 params[:part] = 'subscriberSnippet' params[:my_subscribers] = true end end