Created
October 19, 2009 00:01
-
-
Save uhhuhyeah/212957 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finds videos by tags (keywords). | |
# | |
# You can use the operators +NOT+(-) and +OR+(|). For example: | |
# find_by_tag('cats|dogs', '-rats') | |
def find_by_tag(*tags) | |
url = "videos/-/%7Bhttp%3A%2F%2Fgdata.youtube.com%2Fschemas%2F2007%2Fkeywords.cat%7D" | |
keywords = tags.map{ |t| CGI::escape(t) }.join('/') | |
request("#{url}#{keywords}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment