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