<commit_before>require 'open-uri'
require 'nokogiri'
require 'pry'

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

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

# topic = 'data structures'
# topic = normalize(topic)

def feed(topic)
  doc = Nokogiri::HTML.parse(open("#{BASE_URL}/#{parameterize(topic)}"))
  #questions = doc.css('.link_text').map(&:text)
  # expanded_texts = doc.css('.expanded_q_text').map { }
  paths = doc.css('.question_link').map { |link| link['href'] }
end

puts feed('ruby on rails')
puts
puts feed('gila monster')

binding.pry<commit_msg>Cleans up quorable.rb<commit_after>require 'open-uri'
require 'nokogiri'
require 'pry'

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

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

def feed(topic)
  doc = Nokogiri::HTML.parse(open("#{BASE_URL}/#{parameterize(topic)}"))
  paths = doc.css('.question_link').map { |link| link['href'] }
end
{'fraction_non_alphanumeric': 0.20454545454545456, 'fraction_numerical': 0.0, 'mean_word_length': 5.682758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '179161', 'n_tokens_mistral': 370, 'n_tokens_neox': 365, 'n_words': 63}