Created
October 19, 2010 14:01
-
-
Save gusgollings/634241 to your computer and use it in GitHub Desktop.
Download Tom Waits songs from tomwaits.com
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
#! /usr/bin/env ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
wget = "/usr/local/bin/wget" | |
site = "http://www.tomwaits.com" | |
download_to = "/Users/gus/tmp/" | |
index = open(site + "/songs/") { |f| Hpricot(f) } | |
(index/"#songs-list li a[@class='play-track']").each do |song| | |
page = song.attributes['href'] | |
doc = open(site + page) { |f| Hpricot(f) } | |
song = (doc/"param[@name='flashvars']").first.attributes['value'].split("file=").last | |
songname = download_to + page.split('/').last + ".mp3" | |
puts "This is page: #{page}\n=> getting #{song} as #{songname}" | |
`#{wget} --no-directories --output-document=#{songname} #{site + song}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Songlist:
16 Shells From A ThirtyOught Six
A Little Rain
Alice
All The World Is Green
Back In The Good Old World Gypsy
BurmaShave
Christmas Card from a Hooker in Minneapolis
Clap Hands
Cold Cold Ground
Day After Tomorrow
Eggs And Sausage In A Cadillac With Susan Michelson
Emotional Weather Report
Everything You Can Think
Falling Down
Fannin Street
Get Behind The Mule
Goin Out West
Grapefruit Moon
Heartattack and Vine
Hoist That Rag
Hold On
I Hope That I Dont Fall In Love With You
I Never Talk to Strangers
In The Neighborhood
Innocent When You Dream Barroom
Lie To Me
Misery Is The River Of The World
November
Picking Up After You
Romeo Is Bleeding
Rubys Arms
San Diego Serenade
Sea Of Love
Step Right Up
That Feel
The Black Rider
The Ghosts Of Saturday Night After Hours At Napoleones Pizza House
Time
Tom Trauberts Blues
Underground
You Can Never Hold Back Spring
You Cant Unring a Bell