Created
December 2, 2009 13:05
-
-
Save pjaspers/247182 to your computer and use it in GitHub Desktop.
Simple script to get the links to all of Steve Yegge's articles
This file contains 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 | |
doc = open("http://steve.yegge.googlepages.com/blog-rants") { |f| Hpricot(f) } | |
steves_new_blog << doc.search("div#g_sidebar/a").collect { |a| a.attributes['href']} | |
p steves_new_blog.flatten |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment