I currently have a scraper file called scraper.rb. I need to figure out how to take the output from this and have it display on a Sinatra server. If you could also provide an explanation of why your answer works that would be great, thanks in advance.
require 'httparty'
require 'nokogiri'
url = "https://miami.craigslist.org/search/sof"
response = HTTParty.get url
puts response.body
puts response.headers['content-type']
dom = Nokogiri::HTML(response.body)
num = 0
dom.css("a.hdrlnk").each do |job|
num +=1
print "#{num} "
puts job.content
puts job['href']
end