3 ms·
I like how prominent the words in the Grahamism "make something people want" are - it really shows his commitment to that philosophy.
by kylec 18y ago
I like how prominent the words in the Grahamism "make something people want" are - it really shows his commitment to that philosophy.
- tlrobinson 18y agoThe interesting thing is I counted about 17 instances of "make something people want" in pg's essays and the number of times the individual words are used is much much higher: 742 make 753 something 1589 people 719 want fyi, here's the Ruby code for grabbing the text of all the essays: require 'open-uri' require 'hpricot' text = "" listing = Hpricot(open("http://www.paulgraham.com/articles.html")) (listing/"font"/"a").each do |a| url = a.attributes["href"] puts url essay = Hpricot(open("http://www.paulgraham.com/"+url)) essay.search("script").remove essay.search("link").remove essay.search("meta").remove essay.search("style").remove text += essay.inner_text.gsub(/[\n\r]/, " ") + " " end File.open("pg.txt", 'w') { |f| f.write(text) }
- goodkarma 18y agoRuby code is so damn elegant. :)
- aaronblohowiak 18y agoIt is polite to sleep for a second between requests when scraping.