Class: Feedjira::Youtube::EntryParser
- Inherits:
-
Parser::AtomYoutubeEntry
- Object
- Parser::AtomYoutubeEntry
- Feedjira::Youtube::EntryParser
- Defined in:
- lib/feedjira/youtube/entry_parser.rb
Constant Summary collapse
- LINK_REGEXP =
URI.regexp(%w(http https))
Instance Method Summary collapse
Instance Method Details
#content ⇒ Object
20 21 22 |
# File 'lib/feedjira/youtube/entry_parser.rb', line 20 def content %(#{player_html}<br/><br/>#{summary}) end |
#player_html ⇒ Object
24 25 26 |
# File 'lib/feedjira/youtube/entry_parser.rb', line 24 def player_html %(<iframe width="600" height="375" src="https://www.youtube.com/embed/#{youtube_video_id}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>) end |
#summary ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/feedjira/youtube/entry_parser.rb', line 11 def summary return if super.nil? super .delete("\r") .gsub("\n", "<br/>\n") .gsub(LINK_REGEXP) { %(<a href="#{$&}">#{$&}</a>) } end |