Skip to content

Instantly share code, notes, and snippets.

@acdimalev
Created February 10, 2010 07:45
Show Gist options
  • Save acdimalev/300111 to your computer and use it in GitHub Desktop.
Save acdimalev/300111 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from lxml import etree
doc = etree.parse("http://www.8bitpeoples.com/feed/feed.rss")
links = doc.xpath("//link/child::text()")
albums = [link[-6:] for link in links if 'discography' in link]
print "\n".join(albums)
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::XML.parse(open("http://www.8bitpeoples.com/feed/feed.rss"))
links = doc.xpath("//link").map {|link| link.content}
albums = links.map {|link| link[-6..-1] if link[/discography/]}.compact
print albums.join("\n") + "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment