https://github.com/hubot-archive/hubot-youtube
A hubot script for searching YouTube
https://github.com/hubot-archive/hubot-youtube
Last synced: about 2 months ago
JSON representation
A hubot script for searching YouTube
- Host: GitHub
- URL: https://github.com/hubot-archive/hubot-youtube
- Owner: hubot-archive
- Created: 2014-08-27T00:11:28.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T03:25:38.000Z (4 months ago)
- Last Synced: 2025-04-12T08:41:46.065Z (2 months ago)
- Language: JavaScript
- Size: 827 KB
- Stars: 35
- Watchers: 6
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hubot-youtube
[](http://badge.fury.io/js/hubot-youtube) [](https://github.com/hubot-scripts/hubot-youtube/actions)
A Hubot script for searching YouTube.
## Installation
In the Hubot project repo, run:
`npm install hubot-youtube --save`
Then add **hubot-youtube** to your `external-scripts.json`:
```json
[
"hubot-youtube"
]
```### Obtain a [Google Developer Console](https://console.developers.google.com) token
_Ensure your Project has a billing account connected in order to query the API._
Enable the "YouTube Data API v3" permission from the API menu.

Create a "Public" token rather than the OAuth credentials for this particular implementation.

Copy your token to the `HUBOT_YOUTUBE_API_KEY` environment variable.
```
export HUBOT_YOUTUBE_API_KEY=
```_[Learn more](https://developers.google.com/console/help/new/?hl=en_US#generatingdevkeys) about how to generate Google credentials._
### Optionally set flag for deterministic searching
If you want Hubot to only return the most relevant result rather than randomly one of the top 15 results, set the environment variable `HUBOT_YOUTUBE_DETERMINISTIC_RESULTS`.
```
export HUBOT_YOUTUBE_DETERMINISTIC_RESULTS=true
```### Optionally set flag for listening on public channel
If you want Hubot to listen every messages (without mentioning the bot) on public channel, set `HUBOT_YOUTUBE_HEAR`.
```
export HUBOT_YOUTUBE_HEAR=true
```### Optionally set flag for displaying the video title
If you want Hubot to display the video title along with the URL, set `HUBOT_YOUTUBE_DISPLAY_VIDEO_TITLE`.
```
export HUBOT_YOUTUBE_DISPLAY_VIDEO_TITLE=true
```### Optionally set flag for decoding HTML entities in the video title
If you want Hubot to decode any HTML entities in the video title, set `HUBOT_YOUTUBE_DECODE_HTML`.
```
export HUBOT_YOUTUBE_DECODE_HTML=true
```## Sample Interaction
```
user1> hubot youtube no no no cat remix
hubot> http://www.youtube.com/watch?v=z7OJ3vDqyw8&feature=youtube_gdata
```## Troubleshooting
### Quota Exceeded Error
The YouTube API now requires a billing account attached to your GCP project.