tangled
alpha
login
or
join now
mackuba.eu
/
tootify
2
fork
atom
Toot toooooooot (Bluesky-Mastodon cross-poster)
2
fork
atom
overview
issues
pulls
pipelines
fixed error when alt is longer than 1500
mackuba.eu
1 year ago
bfe675b0
c8088673
+8
2 changed files
expand all
collapse all
unified
split
app
mastodon_account.rb
tootify.rb
+4
app/mastodon_account.rb
···
12
12
@config = File.exist?(CONFIG_FILE) ? YAML.load(File.read(CONFIG_FILE)) : {}
13
13
end
14
14
15
15
+
def max_alt_length
16
16
+
1500
17
17
+
end
18
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
109
+
if alt.length > @mastodon.max_alt_length
110
110
+
alt = alt[0...@mastodon.max_alt_length - 3] + "(…)"
111
111
+
end
112
112
+
109
113
data = @bluesky.fetch_blob(cid)
110
114
111
115
uploaded_media = @mastodon.upload_media(data, cid, mime, alt)