Skip to content

Commit

Permalink
[#7] Define parserservice interface
Browse files Browse the repository at this point in the history
  • Loading branch information
malparty committed Jun 15, 2021
1 parent b713d4a commit 5cc6a1b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions app/services/google_service/parser_service.rb
@@ -0,0 +1,46 @@
# frozen_string_literal: true

module GoogleService
module ParserService
require 'nokogiri'

def initialize(html)
@html = html
@document = Nokogiri::HTML.parse(html)
end

def parse_into(keyword)
keyword.ads_top_count = ads_top_count
keyword.ads_page_count = ads_page_count
keyword.ads_top_url = ads_top_url
keyword.ads_page_url = ads_page_url
keyword.non_ads_result_count = non_ads_result_count
keyword.total_link_count = total_link_count
keyword.html = @html
end

def ads_top_count

end

def ads_page_count

end

def ads_top_url

end

def ads_page_url

end

def non_ads_result_count

end

def total_link_count

end
end
end

0 comments on commit 5cc6a1b

Please sign in to comment.