Method: WebStat::Fetch#youtube_decscription
- Defined in:
- lib/web_stat/fetch.rb
#youtube_decscription ⇒ Object
Get describe of youtube movie.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/web_stat/fetch.rb', line 45 def youtube_decscription regex_string = WebStat::Configure.get["id_extraction_regexs"]["youtube"] if @url.match(regex_string) id = @url.gsub(%r{#{regex_string}.*$}, '\1') youtube = Google::Apis::YoutubeV3::YouTubeService.new youtube.key = WebStat::Configure.get["api_keys"]["youtube"] response = youtube.list_videos(:snippet, id: id) response.items.first.snippet.description end end |