Skip to content

Instantly share code, notes, and snippets.

@pjaspers
Created December 2, 2009 13:05
Show Gist options
  • Save pjaspers/247182 to your computer and use it in GitHub Desktop.
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
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