Class: Lita::Handlers::Youtube

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/youtube.rb

Overview

Listen for YouTube links and respond with their titles and duration.

Constant Summary collapse

API_URL =
"http://gdata.youtube.com/feeds/api/videos/"

Instance Method Summary collapse

Instance Method Details

#query_string(response) ⇒ Object



12
13
14
15
# File 'lib/lita/handlers/youtube.rb', line 12

def query_string(response)
  video_id = extract_video_id(response.matches[0][0])
  get_video_data_and_respond(video_id, response)
end


17
18
19
# File 'lib/lita/handlers/youtube.rb', line 17

def short_link(response)
  get_video_data_and_respond(response.matches[0][1], response)
end