-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to API Token-based search #4
Switch to API Token-based search #4
Conversation
Fixes #3 Prior to this PR, the YouTube Hubot package would return a `devicesupport` link indicating that the search functionality was broken because it was using an outdated API. This moves the search to V3 of the YouTube API and restores functionality. It will require the addition of `YOUTUBE_API_KEY` environment variable.
@@ -18,6 +18,12 @@ Then add **hubot-youtube** to your `external-scripts.json`: | |||
] | |||
``` | |||
|
|||
Obtain a [Google Developer Console](https://console.developers.google.com) token. You will want the "Public" token rather than the OAuth credentials for this particular implementation. [Learn more](https://developers.google.com/console/help/new/?hl=en_US#generatingdevkeys) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also recommend mentioning here to enable the 'YouTube Data API v3' under APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated! Thanks!
This works for me - thanks! |
👍 |
query = msg.match[3] | ||
robot.http("http://gdata.youtube.com/feeds/api/videos") | ||
robot.respond /(?:youtube|yt)(?: me)? (.*)/i, (msg) -> | ||
unless process.env.YOUTUBE_API_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hubot convention is to prefix this with HUBOT_
, ie HUBOT_YOUTUBE_API_KEY
.
I realized I wasn't watching this repo, sorry about that 😓 Looks good aside from the one comment about the environment variable name. If you can update that, I'd be happy to merge ✨ |
I think we'll also want to remove this from the default hubot since it's currently broken, and this update means it won't work out of the box 😓 |
@toshimaru / @SarahKowalik / @Emile-Filteau /etc.: With the change in https://github.com/stephenyeargin/hubot-youtube/commit/dfd7a9c055549d76a849e71b0873301f1de50549 , the environment variable will be renamed @technicalpickles Good to go. |
Switch to API Token-based search
I released this as 1.0.0, thanks! @stephenyeargin I added you as a collaborator here too. No good PR goes unpunished 💖 |
@stephenyeargin All right, thanks. <3 |
Fixes #3
Prior to this PR, the YouTube Hubot package would return a
devicesupport
link indicating that the search functionality was broken because it was using an outdated API. This moves the search to V3 of the YouTube API and restores functionality. It will require the addition ofYOUTUBE_API_KEY
environment variable.Also updated the test spec so it can be Travis-ized.