Toot toooooooot (Bluesky-Mastodon cross-poster)

add embed link at the end if it's not in the post body

Changed files
+12
app
+12
app/tootify.rb
··· 58 58 p record 59 59 60 60 text = expand_facets(record) 61 + 62 + if link = link_embed(record) 63 + if !text.include?(link) 64 + text += ' ' unless text.end_with?(' ') 65 + text += link 66 + end 67 + end 68 + 61 69 p @mastodon.post_status(text) 62 70 end 63 71 ··· 79 87 end 80 88 81 89 bytes.pack('C*').force_encoding('UTF-8') 90 + end 91 + 92 + def link_embed(record) 93 + record['embed'] && record['embed']['external'] && record['embed']['external']['uri'] 82 94 end 83 95 end