GitXplorerGitXplorer
y

yt-auto-curate-ruby

public
15 stars
17 forks
0 issues

Commits

List of commits on branch master.
Unverified
554f235c313e7d96d29809d23c136f4773fc8599

Create CONTRIBUTING.md

uulukaya committed 11 years ago
Unverified
2f2fa63fa258a916ed3eeba600025aef056bf399

Create LICENSE-2.0.txt

uulukaya committed 11 years ago
Unverified
33b14abe5d0a8b0c4760d700cf12b21d63730877

-n

jjeffposnick committed 12 years ago
Unverified
68f2a5ba4188022409b8d28c2d1362ad7ca97f50

-n

jjeffposnick committed 12 years ago

README

The README file for this repository.

The autocurate.rb script uses the YouTube Data API v3 (https://developers.google.com/youtube/v3/) and the Google APIs client library for Ruby (https://code.google.com/p/google-api-ruby-client/) to automatically "watch" a list of videos and take action when a new video is found that meets certain criteria.

You can "watch" anything that corresponds to a YouTube video list: any channel's uploads ('UU' + channel id), favorites ('FL' + channel id), likes ('LL' + channel id), or any YouTube playlist ('PL...'). Each time the script is run, it checks for videos that have been added to the list since the last time it ran, so you can run it repeatedly without processing the same video multiple times.

When you're "watching" a playlist, the titles of new videos are checked to see if they match a specific regular expression. If the title matches, then one or more actions are triggered.

There are two types of actions that can be configured: adding the video to a playlist (in the currently authenticated channel) or posting a channel bulletin with a link to the video.

By default, the script looks for a file called 'config.json' within the current directory and reads its configuration from there. Here's an example configuration with comments:

[ { "uploads_list_id": "UU_x5XG1OV2P6uZZ5FSM9Ttw", "actions": [ { "playlist_id": "PLhBgTdAWkxeCMHYCQ0uuLyhydRJGDRNo5", "regex": "YouTube Developers Live" }, { "bulletin": "A new YouTube API video was uploaded to the GoogleDevelopers channel.", "regex": "YouTube" } ] } ]

This configuration instructs the script to "watch" the playlist 'UU_x5XG1OV2P6uZZ5FSM9Ttw', which corresponds to the videos uploaded by the channel with id '_x5XG1OV2P6uZZ5FSM9Ttw' (i.e. http://www.youtube.com/googledevelopers).

Whenever it finds a new video in that list, it attempts to match the title with two different regular expressions. If it matches /YouTube Developers Live/, the the video is added to the playlist with id 'PLhBgTdAWkxeCMHYCQ0uuLyhydRJGDRNo5' (which much belong to the currently authenticated channel). If it matches /YouTube/ then the video is also added as a channel bulletin to the currently authenticated channel, with the accompanying text 'A new YouTube API video was uploaded to the GoogleDevelopers channel.'

Right now only the video's title is checked for matches, but it's possible to extend the script to check the description as well.