From 34a69da36e1a4dd862a360d5bbef749f0f329d2e Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 11 Dec 2014 10:02:05 +0100 Subject: First commit. A simple ruby app to download the 78's from http://78records.cdbpdx.com/ Just because clicking on close to 6000 files is a bit too much. --- lib/seventy_eights/record.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lib/seventy_eights/record.rb (limited to 'lib/seventy_eights/record.rb') diff --git a/lib/seventy_eights/record.rb b/lib/seventy_eights/record.rb new file mode 100644 index 0000000..2abbb69 --- /dev/null +++ b/lib/seventy_eights/record.rb @@ -0,0 +1,22 @@ +require 'nokogiri' +require 'open-uri' + +module SeventyEights + class Record + attr_reader :title, :artist, :label, :catalog, :url + + def initialize(title, artist, label, catalog, url) + @title, @artist, @label, @catalog, @url = title, artist, label, catalog, url + end + + def to_filename + "#{safe @title} - #{safe @artist} - #{safe @label} - #{safe @catalog}.mp3" + end + + private + + def safe(str) + str.gsub('/', '-') + end + end +end -- cgit v1.2.3