Skip to content
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

Merged
merged 5 commits into from
Jun 6, 2015
Merged

Switch to API Token-based search #4

merged 5 commits into from
Jun 6, 2015

Conversation

stephenyeargin
Copy link
Member

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.

Also updated the test spec so it can be Travis-ized.

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)

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! Thanks!

@Sarah-E-Greene
Copy link

This works for me - thanks!

@toshimaru
Copy link

👍

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
Copy link
Contributor

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.

@technicalpickles
Copy link
Contributor

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 ✨

@technicalpickles
Copy link
Contributor

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 😓

@stephenyeargin
Copy link
Member Author

@toshimaru / @SarahKowalik / @Emile-Filteau /etc.:

With the change in https://github.com/stephenyeargin/hubot-youtube/commit/dfd7a9c055549d76a849e71b0873301f1de50549 , the environment variable will be renamed HUBOT_YOUTUBE_API_KEY instead of YOUTUBE_API_KEY. This will probably be a breaking change when this merges if you are running it in a production environment.

@technicalpickles Good to go.

technicalpickles added a commit that referenced this pull request Jun 6, 2015
@technicalpickles technicalpickles merged commit 61658df into hubot-archive:master Jun 6, 2015
@technicalpickles
Copy link
Contributor

I released this as 1.0.0, thanks!

@stephenyeargin I added you as a collaborator here too. No good PR goes unpunished 💖

@toshimaru
Copy link

@stephenyeargin All right, thanks. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

YouTube now returning broken video
4 participants