class Tychus::Parsers::FoodNetworkParser
Public Class Methods
uri_host()
click to toggle source
# File lib/tychus/parsers/food_network_parser.rb, line 4 def self.uri_host "foodnetwork.com" end
Public Instance Methods
parse_description()
click to toggle source
# File lib/tychus/parsers/food_network_parser.rb, line 17 def parse_description # Foodnetwork does not use the description in its recipe body # resort to opengraph to pull out description in head # TODO: pull this func out for an opengraph parser? @doc.css('meta[property="og:description"]').first.attr('content') end
parse_ingredients()
click to toggle source
# File lib/tychus/parsers/food_network_parser.rb, line 24 def parse_ingredients recipe_doc .css('[itemprop="ingredients"]') .map { |node| node.content.lstrip.squeeze(" ").chomp } end