Skip to content

Instantly share code, notes, and snippets.

@JamesZoft
Created June 15, 2012 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesZoft/2935549 to your computer and use it in GitHub Desktop.
Save JamesZoft/2935549 to your computer and use it in GitHub Desktop.
def give_youtube_description(line)
channel = get_input_channel(line)
if line =~ /.*youtube.com.*/
url = line.gsub(/.*\:/, '').gsub(/.*youtube/, 'youtube').strip.gsub(/\ .*/, '')
puts url
begin
page = open("http://www." + url)
contents = page.read.gsub(/.*meta name="keywords" content="/m, '').gsub(/".*/m, '').strip
puts channel + " " + url + " " + contents
send("PRIVMSG " + channel + " :http://www." + url + " " + contents)
rescue
send("PRIVMSG " + channel + " :This video does not exist.")
raise
end
end
end
@JamesZoft
Copy link
Author

Eh?

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