Sha256: 91e39a300c2ced11f342b1e9c77696ee0615f76f324b6e3225dcaa0d80dee93e

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

require 'open-uri'
require 'nokogiri'
require 'pry'

module Quorable
  URL = 'http://www.quora.com'

  def self.feed(topic)
    doc = Nokogiri::HTML.parse(open("#{URL}/#{Quorable.parameterize(topic)}"))
    doc.css('.question_link').map { |link| "#{URL}#{link['href']}" }
  end

  private

  def self.parameterize(topic)
    topic.split.map(&:capitalize).join('-')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quorable-0.1.8 lib/quorable.rb