Skip to content

Instantly share code, notes, and snippets.

@acdimalev
Created February 10, 2010 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save acdimalev/300157 to your computer and use it in GitHub Desktop.
Save acdimalev/300157 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
class Array
alias :_old_index_op :[]
def [] a
if a.is_a?(Regexp) then
select {|b| b[a]}
else
_old_index_op a
end
end
end
doc = Nokogiri::XML.parse(open("http://www.8bitpeoples.com/feed/feed.rss"))
links = doc.xpath("//link").map {|link| link.content}
albums = links[/discography/].map {|link| link[-6..-1]}
print albums.join("\n") + "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment