youtube-testnet
v1.1.7
Published
[![npm version](https://badge.fury.io/js/hubot-youtube.svg)](http://badge.fury.io/js/hubot-youtube) [![Node.js CI](https://github.com/hubot-scripts/hubot-youtube/workflows/Node.js%20CI/badge.svg)](https://github.com/hubot-scripts/hubot-youtube/actions)
Downloads
22
Readme
hubot-youtube
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
:
["hubot-youtube"]
hallo
Obtain a Google Developer Console 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=<your token>
Learn more 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.