A hubot script for searching YouTube
See src/youtube.coffee
for full documentation.
In hubot project repo, run:
npm install hubot-youtube --save
Then add hubot-youtube to your external-scripts.json
:
[
"hubot-youtube"
]
Obtain a Google Developer Console token
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.
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
If you want hubot to listen every messages (without mentioning him) on public channel
export HUBOT_YOUTUBE_HEAR=true
user1> hubot youtube no no no cat remix
hubot> http://www.youtube.com/watch?v=z7OJ3vDqyw8&feature=youtube_gdata