https://github.com/deanpcmad/youtuberb
Ruby library for the YouTube Data v3 API
https://github.com/deanpcmad/youtuberb
Last synced: about 2 months ago
JSON representation
Ruby library for the YouTube Data v3 API
- Host: GitHub
- URL: https://github.com/deanpcmad/youtuberb
- Owner: deanpcmad
- License: mit
- Created: 2022-11-03T11:33:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-21T11:02:52.000Z (over 1 year ago)
- Last Synced: 2024-04-23T13:09:56.348Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# YouTubeRB
**This library is a work in progress**
YouTubeRB is a Ruby library for interacting with the YouTube Data v3 API.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'youtuberb'
```## Usage
### Set Client Details
Firstly you'll need to set an API Key. A user Access Token is required to access private data.
An Access Token will be an OAuth2 token generated after authentication.```ruby
# To access public data, just an API Key is required
@client = YouTube::Client.new(api_key: "")# Or to access data for a user, an Access Token is also required
@client = YouTube::Client.new(api_key: "", access_token: "")
```### Channels
```ruby
# Get the Channel details of the currently authenticated user
@client.channels.mine# Get a Channel by ID
@client.channels.retrieve(id: "channel_id")# Get a Channel by username
@client.channels.retrieve(username: "username")
```### Videos
```ruby
# Get a single video
@client.videos.list(id: "abc123")
# => # # # #