lib/quorable.rb in quorable-0.1.6 vs lib/quorable.rb in quorable-0.1.7
- old
+ new
@@ -5,11 +5,14 @@
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'] }
+ paths = doc.css('.question_link').map { |link| "#{BASE_URL}#{link['href']}" }
+ paths
end
+
+ private
def self.parameterize(topic)
topic.split(' ').map(&:downcase).map(&:capitalize).join('-')
end
end
\ No newline at end of file