Sha256: 7b8f7d457bb79c86ea075a36a5a8bdaf292c6499e7df049d49d2539bc43fb5ca

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

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

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

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

  def self.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.6 lib/quorable.rb