summaryrefslogtreecommitdiff
path: root/mail.rb
diff options
context:
space:
mode:
Diffstat (limited to 'mail.rb')
-rwxr-xr-xmail.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/mail.rb b/mail.rb
index 35d495d..1aac68c 100755
--- a/mail.rb
+++ b/mail.rb
@@ -8,18 +8,28 @@ mailfile = if ARGV[1] and ARGV[1] == 'publish'
Dir.chdir ARGV[0]
date, title = File.basename(ARGV[0]).split('_', 2)
+nr_tracks = Dir['*.flac'].size
+type = if nr_tracks == 1
+ 'single'
+ elsif nr_tracks < 6
+ 'ep'
+ elsif nr_tracks > 0
+ 'lp'
+ end
content = ["From: info@pdp8.info
-Subject: [pdp8] #{title.gsub('_', ' ')}
+Subject: [pdp8] #{title.gsub('_', ' ')} #{type}
Content-Type: text/plain
List-Unsubscribe: <mailto: info@pdp8.info?subject=unsubscribe>"]
content << ''
-content << File.read('README')
+content << "the new pdp8 #{type} \"#{title.gsub('_', ' ')}\" is online:"
+# content << File.read('README').chomp
content << ''
-content << "https://pdp8.info/music.html\##{date}"
+content << "web: https://pdp8.info/music.html\##{date}"
+content << "internet archive: https://archive.org/details/pdp8_#{title}"
bc = if File.exist?('bandcamp')
- File.read('bandcamp').chomp
+ "bandcamp: #{File.read('bandcamp').chomp}"
else
- "https://pdp8.bandcamp.com/album/#{title.gsub(' ', '-')}"
+ "bandcamp: https://pdp8.bandcamp.com/album/#{title.gsub('_', '-')}"
end
content << bc
content << ''