Sha256: 5033668da6dde91cad4fe827eab3d52f6ae4a78a7378b06be177993f21858830
Contents?: true
Size: 383 Bytes
Versions: 1
Compression:
Stored size: 383 Bytes
Contents
require 'open-uri' require 'nokogiri' require 'pry' module Quorable BASE_URL = 'http://www.quora.com' def feed(topic) doc = Nokogiri::HTML.parse(open("#{BASE_URL}/#{parameterize(topic)}")) paths = doc.css('.question_link').map { |link| link['href'] } end private def parameterize(topic) topic.split(' ').map(&:downcase).map(&:capitalize).join('-') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
quorable-0.1.2 | lib/quorable.rb |