summaryrefslogtreecommitdiff
path: root/mail.rb
diff options
context:
space:
mode:
authorpdp8 <pdp8@pdp8.info>2024-03-04 13:42:04 +0100
committerpdp8 <pdp8@pdp8.info>2024-03-04 13:42:04 +0100
commit6b40f3b54efabb740e825ba3d94b5695c2b98ede (patch)
tree2e2fae35cae72f73878cd5295e0f183891e284dc /mail.rb
parent4bd4cb578ee4579eaa81efec4b478654fae8e236 (diff)
disallow AI bots in robots.txt, mail.rb title, valid rss
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 << ''