Method: ContentPreview::Parser#process
- Defined in:
- lib/content-preview/parser.rb
#process(url) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/content-preview/parser.rb', line 12 def process(url) return unless url =~ /^http\:\/\// begin document = Nokogiri::HTML(open(url)) process_open_graph(document) (document, url) # Return computed data { 'title' => self.title, 'description' => self.description, 'images' => self.images, 'video' => self.video } rescue Exception => e nil end end |