This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
# Steve's *cough* new blog | |
doc = open("http://steve-yegge.blogspot.com/") { |f| Hpricot(f) } | |
steves_new_blog = Array.new() | |
(doc/"ul.posts").each { |post|steves_new_blog << post.search("li/a").collect { |a| a.attributes['href']}} | |
# Steves old blog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A quick way to tweet from the command line | |
# As for the name: http://itunes.com/app/oak by @10to1 | |
# Added 'oak' as source. | |
function beech(){ | |
# Twitter != Rocket Science, so security is not that much of an issue | |
TWITTER_BEECH_USER="username" | |
TWITTER_BEECH_PASS="password" | |
if [ $# -ge 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'lingua/en/readability' | |
class Haiku | |
def initialize(text) | |
@report = Lingua::EN::Readability.new(text) | |
@used_words = Array.new | |
end | |
def get_most_used_words(words) | |
top_words = Array.new | |
words.sort{|a,b| a[1]<=>b[1]}.slice(words.length/2..words.length).each do |a| |
NewerOlder