Template of a custom feed generator service for the Bluesky network in Ruby

added some helpers in Post model

Changed files
+30
app
models
+30
app/models/post.rb
··· 33 33 "at://#{repo}/app.bsky.feed.post/#{rkey}" 34 34 end 35 35 36 + def quoted_post_uri 37 + if embed = record['embed'] 38 + if embed['$type'] == "app.bsky.embed.record" 39 + return embed['record']['uri'] 40 + elsif embed['$type'] == "app.bsky.embed.recordWithMedia" 41 + if embed['record']['$type'] == "app.bsky.embed.record" 42 + return embed['record']['record']['uri'] 43 + end 44 + end 45 + end 46 + 47 + return nil 48 + end 49 + 50 + def thread_root_uri 51 + if root = (record['reply'] && record['reply']['root']) 52 + root['uri'] 53 + else 54 + nil 55 + end 56 + end 57 + 58 + def parent_uri 59 + if parent = (record['reply'] && record['reply']['parent']) 60 + parent['uri'] 61 + else 62 + nil 63 + end 64 + end 65 + 36 66 def trim_too_long_data 37 67 if embed = record['embed'] 38 68 if external = embed['external']