Class: Googol::YoutubeAccount
- Inherits:
-
Object
- Object
- Googol::YoutubeAccount
- Includes:
- Authenticable, PlaylistItems, Playlists, Readable, Subscriptions
- Defined in:
- lib/googol/youtube_account.rb
Overview
Provides read & write access to a Youtube account (also known as Channel).
Instance Method Summary collapse
-
#info ⇒ Hash
Return the profile info of a Youtube account/channel.
-
#like!(target = {}) ⇒ Object
Like a video as a Youtube account.
Methods included from Subscriptions
#subscribe_to, #subscribe_to!, #unsubscribe_from, #unsubscribe_from!
Methods included from PlaylistItems
#add_item_to!, #add_videos_to!, #remove_all_items_from!
Methods included from Playlists
#create_playlist!, #delete_playlists!, #find_or_create_playlist_by, #find_playlist_by, #update_playlist!
Methods included from Readable
#description, #id, #kind, #thumbnail_url, #title
Methods included from Authenticable
Methods included from Requestable
Methods included from ClientTokens
#client_id, client_id=, #client_secret, client_secret=
Instance Method Details
#info ⇒ Hash
Return the profile info of a Youtube account/channel.
44 45 46 47 |
# File 'lib/googol/youtube_account.rb', line 44 def info @info_response ||= youtube_request! path: '/channels?part=id,snippet&mine=true' @info_response[:items].first end |
#like!(target = {}) ⇒ Object
Note:
Liking a video does not also subscribe to its channel
Like a video as a Youtube account
58 59 60 61 62 |
# File 'lib/googol/youtube_account.rb', line 58 def like!(target = {}) video_id = fetch! target, :video_id path = "/videos/rate?rating=like&id=#{video_id}" youtube_request! path: path, method: :post, code: 204 end |