Toot toooooooot (Bluesky-Mastodon cross-poster)

fixed error when alt is longer than 1500

Changed files
+8
app
+4
app/mastodon_account.rb
··· 12 12 @config = File.exist?(CONFIG_FILE) ? YAML.load(File.read(CONFIG_FILE)) : {} 13 13 end 14 14 15 + def max_alt_length 16 + 1500 17 + end 18 + 15 19 def save_config 16 20 File.write(CONFIG_FILE, YAML.dump(@config)) 17 21 end
+4
app/tootify.rb
··· 106 106 cid = image['image']['ref']['$link'] 107 107 mime = image['image']['mimeType'] 108 108 109 + if alt.length > @mastodon.max_alt_length 110 + alt = alt[0...@mastodon.max_alt_length - 3] + "(…)" 111 + end 112 + 109 113 data = @bluesky.fetch_blob(cid) 110 114 111 115 uploaded_media = @mastodon.upload_media(data, cid, mime, alt)