diff options
-rwxr-xr-x | internetarchive.sh | 11 | ||||
-rwxr-xr-x | mail.rb | 2 | ||||
-rwxr-xr-x | social.rb | 18 |
3 files changed, 22 insertions, 9 deletions
diff --git a/internetarchive.sh b/internetarchive.sh new file mode 100755 index 0000000..d987095 --- /dev/null +++ b/internetarchive.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +cd $1 +dir=$(basename $1) +date=$(echo $dir|cut -f1 -d '_') +album=$(echo $dir|cut -f2- -d '_') +title=$(echo $album| sed 's/_/ /g') +url=https://pdp8.info/music.html#$date +description="$(sed 's/^$/<br>/' README) <p> original release: <a href="$url">$url</a> " +description=$(echo $description) # remove newlines +ia upload pdp8_$album *flac cover.jpeg --metadata="title:$title" --metadata="mediatype:audio" --metadata="licenseurl:http://creativecommons.org/licenses/by-sa/4.0/" --metadata="date:$date" --metadata="description:$description" --metadata="artist:pdp8@pdp8.info" --metadata="album:$album" --metadata="creator:pdp8@pdp8.info" --metadata="genre:electronic,techno"
\ No newline at end of file @@ -26,7 +26,7 @@ content << '' content << '==' content << 'List-Unsubscribe: <mailto: info@pdp8.info?subject=unsubscribe>' File.open('/tmp/mail.txt', 'w+') { |f| f.puts content.join("\n") } -# system 'hx /tmp/mail.txt' +system 'hx /tmp/mail.txt' content = File.read('/tmp/mail.txt') File.open(mailfile).each_line do |mail| @@ -4,11 +4,13 @@ require 'json' Dir.chdir ARGV[0] content = ['public', '', ''] -content << File.read('README') -content << '' date, title = File.basename(ARGV[0]).split('_', 2) +title.gsub!('_', ' ') +content << title + ' LP' +content << File.read('README') +# content << '' content << "https://pdp8.info/music.html\##{date}" -content << '' +# content << '' bc = if File.exist?('bandcamp') File.read('bandcamp').chomp else @@ -16,16 +18,16 @@ bc = if File.exist?('bandcamp') end content << "Bandcamp: #{bc}" content << '' -content << "#creativecommons \##{File.basename ARGV[0]}" +content << '#creativecommons #electronic #music #techno' content << '==' content << File.join("https://media.pdp8.info/music/#{File.basename ARGV[0]}", - 'cover.jpeg') + "\t" + `exiv2 -K Xmp.dc.description -P v /srv/media/music/2023-07-05_blurred_boundaries_of_perception/cover.jpeg`.chomp.sub( + 'cover.jpeg') + "\t" + `exiv2 -K Xmp.dc.description -P v cover.jpeg`.chomp.sub( /^lang=\S+ /, '' ) -Dir['*mp3'].each do |mp3| - content << File.join("https://media.pdp8.info/music/#{File.basename ARGV[0]}", "#{File.basename mp3}") -end +# Dir['*mp3'].each do |mp3| +# content << File.join("https://media.pdp8.info/music/#{File.basename ARGV[0]}", "#{File.basename mp3}") +# end File.open('/tmp/content.txt', 'w+') { |f| f.puts content.join("\n") } system 'hx /tmp/content.txt' puts `curl -sb cookies.txt --data-binary @/tmp/content.txt -X POST https://social.pdp8.info/create` |